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

If another advanced civilization lived on Earth before us, would we know?

https://www.cnn.com/2026/07/25/climate/silurian-hypothesis-another-civilization-before-humans
1•samizdis•2m ago•0 comments

Atari 2600 TV Ads – By Paul Lefebvre

https://www.goto10retro.com/p/atari-2600-tv-ads
1•rbanffy•2m ago•0 comments

Watching Go's new garbage collector move through the heap – The Consensus

https://theconsensus.dev/p/2026/07/19/observing-gos-garbage-collector-old-and-new.html
2•rbanffy•4m ago•0 comments

Is AI used in school system and how are they implementing it

1•rohankc_01•6m ago•0 comments

GM Backs Sodium Ion Batteries for U.S. Grid Storage

https://spectrum.ieee.org/sodium-ion-battery-peak-energy
5•rbanffy•9m ago•0 comments

I built a new PoW protocol and observed a surprisingly early solution

2•babakkarimib•12m ago•0 comments

How A Gang of Thieves Pulled Off a Multimillion-Dollar Data Center Heist

https://www.nytimes.com/2026/07/12/magazine/data-center-heist.html
2•chirau•15m ago•2 comments

You Do Not Need a Server for Agent Evals

https://medium.com/@chalyi/you-do-not-need-a-server-for-you-agent-evals-a145962298be
2•chalyi•15m ago•0 comments

Harry Potter and the Philosopher's Stone

https://en.wikipedia.org/wiki/Harry_Potter_and_the_Philosopher%27s_Stone
2•chistev•17m ago•0 comments

Tesla's robotaxis are moving in reverse

https://techcrunch.com/2026/07/23/teslas-robotaxis-are-moving-in-reverse/
4•decimalenough•23m ago•0 comments

International Child Abduction in Japan

https://en.wikipedia.org/wiki/International_child_abduction_in_Japan
3•croes•23m ago•0 comments

Who Gets Saved in the New West?

https://www.playboy.com/read/politics/who-gets-saved-in-the-new-west
2•littlexsparkee•24m ago•0 comments

A 77-year-old Republican man is staging a solo protest against Flock cameras

https://www.cltampa.com/news/a-77-year-old-republican-man-is-staging-a-solo-protest-against-st-pe...
15•UmYeahNo•26m ago•7 comments

Ask HN: What's expected from an engineering manager or director now?

3•agentwrangler•31m ago•1 comments

Mac OS 7 on x86 [video]

https://www.youtube.com/watch?v=rJRlHKQqX2M
3•tambourine_man•32m ago•1 comments

Israel's $50M Experiment to Change U.S. Public Opinion

https://www.wsj.com/politics/israels-50-million-experiment-to-change-u-s-public-opinion-253b3b70
5•abdelhousni•34m ago•2 comments

AMD publishes machine-readable ISA so frontier models can write its GPU kernels

https://www.theregister.com/ai-and-ml/2026/07/24/amd-vibe-codes-its-way-past-the-cuda-moat-with-r...
3•logickkk1•36m ago•0 comments

Tech titans' playbook to defy Aussie social media ban

https://www.afr.com/technology/big-tech-tricks-undermining-social-media-ban-wells-20260331-p5zk5e
2•asdefghyk•36m ago•0 comments

Becoming a Research Engineer at a Big LLM Lab

https://www.maxmynter.com/pages/blog/jobhunt
3•felixdoerp•38m ago•0 comments

Why our exoplanet map looks like a cone? [video]

https://www.youtube.com/watch?v=ZF_Q4C_Yhz8
3•hakkikonu•39m ago•0 comments

Daraxonrasib or Chemotherapy in Previously Treated Metastatic Pancreatic Cancer

https://www.nejm.org/doi/full/10.1056/NEJMoa2605555?query=WB
2•maxall4•40m ago•0 comments

'AI Mania Is Eviscerating Global Decision-Making'

https://daringfireball.net/linked/2026/07/25/ai-mania-nikhil-suresh
22•robenkleene•40m ago•3 comments

AIs Favourite Number

https://sackfield.substack.com/p/ais-favourite-number
2•sackfield•41m ago•0 comments

ExploitGym – Can AI Agents Turn Security Vulnerabilities into Real Attacks?

https://www.cybergym.io/exploitgym/
2•882542F3884314B•41m ago•0 comments

The Great Rate Reset

https://www.axios.com/2026/07/23/rates-treasury-yields-borrowing
3•toomuchtodo•43m ago•0 comments

JIT Go Brrr: The Path to a Supported JIT Compiler for CPython

https://peps.python.org/pep-0836/
2•programLyrique•44m ago•0 comments

Color Generator

https://kigen.design/color
3•arnon•48m ago•0 comments

Toolgz – cut LLM tool-definition tokens ~80% without hurting accuracy

https://github.com/dperussina/toolgz
2•dperussina•52m ago•0 comments

What's horned, fluffy, and ethically dubious? Yak clones

https://www.cnn.com/2026/07/25/china/tibet-yak-clones-conservation-intl-hnk-dst
3•naves•54m ago•0 comments

Claude Opus 5: The System Card

https://thezvi.substack.com/p/claude-opus-5-the-system-card
3•paulpauper•55m ago•0 comments