frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: Which function definition keyword do you prefer, def or fn?

1•winwang•1y ago
I'm curious about what people think of `def` vs `fn`, two short keywords for starting function definitions.

...Or maybe we should subscribe to the church of `df`, haha.

Comments

sitkack•1y ago
def could be for lots of things, fn is for functions. I don't think it matters much as long as you have one. C would have been so much easier to parse. Just copy Zig or Rust.
butlersean•1y ago
def means define, could be used to define all kinds of things

fn isnt a legitimate short form of function

fun doesnt work because of the amusement factor

func is the only alternative we have left

sitkack•1y ago
How about unicode or emojis?

These don't have the full fidelity as hn scrubs emojis

add = (a, b) -> a + b

a, b ⟹ a + b

λ add(a, b): ↪ a + b

johncoltrane•1y ago
"def" is too generic.

"fn" is too cryptic.

"function" is better than the two.

MultifokalHirn•1y ago
Agreed

Floci: a fast, free, and open-source local AWS service emulator

https://floci.io/floci/
1•Tomte•2m ago•0 comments

Calculator built to teach/experiment with costing LLM chat apps

https://calc.ajinkya.ai/
1•csmonk•4m ago•0 comments

I ran an AI nuclear engineering department for a week

https://charlesazam.com/blog/ai-engineering-department/
1•couAUIA•5m ago•0 comments

RefCam Bayer Leverkusen vs. FC Bayern [video]

https://www.youtube.com/watch?v=5Nuf_Y-tBeI
2•mmarian•6m ago•1 comments

Command and Conquer Generals natively ported to macOS, iPhone, iPad using Fable

https://github.com/ammaarreshi/Generals-Mac-iOS-iPad/tree/main
4•asronline•7m ago•3 comments

The Feeling of Recursion

https://icely.neocities.org/articles/recursion
2•icely•11m ago•0 comments

I built a game where people solve mazes together

https://maze.cleoselene.com/hackernews
2•brunovcosta•13m ago•0 comments

AI-writing-pattern linter that kept flagging my own README

https://github.com/Shirhussain/humanize
2•danishyar•15m ago•0 comments

Show HN: Typocalypse – An Arcade Typing Roguelike

https://typocalypse.florianrudaj.com/
2•florianrudaj•19m ago•0 comments

Putting an Agent in an Orb

https://ampcode.com/notes/putting-an-agent-in-an-orb
2•tosh•25m ago•0 comments

Generative AI creates delicious, sustainable, and nutritious burgers

https://www.nature.com/articles/s41538-026-00953-x
2•nojito•28m ago•0 comments

There Are Few Socialists in America

https://paulkrugman.substack.com/p/there-are-very-few-socialists-in
3•rbanffy•29m ago•0 comments

Image-to-emoji ASCII art generation

https://philatype.github.io/mojsaic/
2•busymom0•32m ago•0 comments

A Little Machine Near the Sun – Ecuador Robot Climbs Chimborazo

https://latinamericanpost.com/science-technology/ecuador-robot-climbs-chimborazo-as-science-gets-...
2•dxs•33m ago•0 comments

Iredis

https://github.com/laixintao/iredis
2•Olshansky•35m ago•0 comments

The Consequences of Caste in Village India

https://nicholasdecker.substack.com/p/the-consequences-of-caste-in-village
2•paulpauper•36m ago•0 comments

A damage accumulation model identifies distinct aging regimes across species

https://www.nature.com/articles/s43587-026-01138-7
3•paulpauper•36m ago•0 comments

AMD pivots from HBM to LPDDR5X for new Versal Gen 2 memory on package chips

https://www.servethehome.com/amd-pivots-from-hbm-to-lpddr5x-for-new-versal-premium-gen-2-memory-o...
2•teleforce•37m ago•0 comments

US and Chinese companies train almost all of the most-used AI models

https://ourworldindata.org/data-insights/us-and-chinese-companies-train-almost-all-of-the-worlds-...
5•01-_-•38m ago•0 comments

Wicklow hotel cancels 'secretive' Peter Thiel group conference

https://www.irishtimes.com/ireland/2026/07/03/wicklow-hotel-cancels-secretive-peter-thiel-confere...
6•01-_-•39m ago•0 comments

We Love This Country

https://www.thefp.com/p/why-we-love-this-country
2•paulpauper•40m ago•0 comments

Nearly a Million Investors Lost a Total of $3.8B on Trump Crypto Coin

https://www.nytimes.com/2026/07/04/us/politics/trump-coin-crypto-investors-loss.html
10•MilnerRoute•41m ago•3 comments

Anthropic wants to develop its own drugs

https://www.theverge.com/ai-artificial-intelligence/961311/anthropic-claude-science-ai-drug-devel...
3•erhuve•47m ago•0 comments

Instagram running ads promoting child sexual abuse material in India, BBC finds

https://www.bbc.com/news/articles/cvgm4e0316zo
2•muralimadhu•49m ago•0 comments

Ask HN: Where are the good search engines for mathematical formulas?

2•lo0dot0•50m ago•0 comments

Apple Hide My Email Reveals the User’s Real Email

https://www.404media.co/apple-hide-my-email-vulnerability-reveals-peoples-real-email-addresses/
3•oldfuture•54m ago•1 comments

EU appears to find datacenter emissions easier to offset than lobbyists

https://www.theregister.com/on-prem/2026/07/03/eu-appears-to-find-datacenter-emissions-easier-to-...
7•Bender•57m ago•0 comments

What is a quantum computer good for? nothing – yet

https://www.theverge.com/science/959466/quantum-computer-majorana-2-microsoft-trump-eo
3•joak•57m ago•2 comments

Shaper3d is too expensive so I vibe coded this for Woodwork design

https://designer.vos.lol/
2•AndrewVos•1h ago•1 comments

Go-K8SDeploy – A <50MB RAM GitOps engine with tamper-evident audit logs

https://github.com/Your-Net-Tech/Go-K8SDeploy
2•ynetx•1h ago•0 comments