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

Most engineers fail behavioral interviews because they prepare wrong. Here's

https://leetcopilot.dev/blog/behavioral-interview-prep-complete-guide
1•alexwang24•36s ago•0 comments

US Supreme Court won't block Texas app store age verification law

https://www.reuters.com/world/us-supreme-court-wont-block-texas-app-store-age-verification-law-20...
1•1vuio0pswjnm7•1m ago•0 comments

Deleting Systems You Don't Understand

https://idiallo.com/blog/deleting-systems-you-dont-understand
1•surprisetalk•2m ago•0 comments

The story behind APC-2

https://teenage.engineering/now
1•firloop•2m ago•0 comments

Fitting a regular expression to a list of words

https://www.johndcook.com/blog/2026/07/19/fitting-a-regex/
1•ibobev•3m ago•0 comments

US banks insulated from AI data centre downturn

https://www.thebanker.com/content/db39aacf-703b-4fc2-8501-eebb5a831f0a
1•petethomas•3m ago•0 comments

Generating Lean 4 and SWI Prolog code with Grok 4.5

https://www.johndcook.com/blog/2026/07/20/grok-chess/
1•ibobev•3m ago•0 comments

Volume to Area Ratio for Regular Solids

https://www.johndcook.com/blog/2026/07/20/volume-area-regular-solids/
1•ibobev•4m ago•0 comments

Why diffusion models create new images instead of copies

https://research.google/blog/towards-demystifying-the-creativity-of-diffusion-models/
1•BlueBerry2001•4m ago•0 comments

The classic Java RSS reader won't run in 2026, so I rebuilt it to the web

https://vaadin.com/blog/i-let-ai-rebuild-a-dead-java-desktop-app-for-the-web.-heres-where-it-broke
1•spicyroman•4m ago•0 comments

The year of sustainable indie products

https://olly.world/the-year-of-sustainable-indie-products
1•jamiemchale•4m ago•0 comments

The lock around WAL flush

https://frn.sh/pgfsync/
1•haeseong•5m ago•0 comments

Cohere-Powered Canadian Chatbot (Privacy Focused)

https://dialoga.ca/
2•schmitech•6m ago•1 comments

Show HN: Competiflow – monitor competitor pricing, changelogs, blogs

https://competiflow.com/
3•nyku•7m ago•0 comments

Show HN: Wordgem, a Daily Word Game

https://wordgem.xyz
2•solbreslin•7m ago•1 comments

HugstonOne Architecture, Capability, Benchmark to Privacy Local AI Workstation

https://zenodo.org/records/21471816
1•trilogic•8m ago•0 comments

When "Dr." Comes with a Receipt

https://medium.com/@brothke/when-dr-comes-with-a-receipt-f98e74114313
1•benrothke•10m ago•0 comments

Postgres 19 Compression: from pglz to LZ4

https://www.crunchydata.com/blog/postgres-19-compression-from-pglz-to-lz4
2•zimpenfish•11m ago•0 comments

Show HN: Blog in WASM Linux

2•unmayx•12m ago•1 comments

We spent months building AI agents. Then we deleted them

https://runnit.io/articles/we-spent-months-building-ai-agents-into-runnit-then-we-deleted-them
2•marktolson•12m ago•0 comments

We built the delivery evidence chain

https://www.appaloft.com/blog/delivery-evidence-chain/
1•nichenqin•15m ago•0 comments

Show HN: VidDojo – Turn any YouTube video into an interactive course

https://viddojo.com
1•luka911a•16m ago•0 comments

Stagehand: The AI-Driven Browser Automation Framework

https://www.akashtandon.in/interactive-explainers/stagehand/
1•akashtndn•18m ago•0 comments

Tell HN: GitHub notifications email is full

4•sph•18m ago•0 comments

Hugging Face turns to GLM 5.2 to fend off AI agent attack

https://venturebeat.com/security/safety-guardrails-blocked-hugging-faces-defenders-not-the-attack...
1•tchalla•19m ago•0 comments

New US homeownership measure puts people first

https://www.minneapolisfed.org/article/2026/new-homeownership-measure-puts-people-first
5•throw0101a•19m ago•0 comments

Show HN: Shellink – let AI agents run commands on servers behind jump hosts

https://github.com/jie123108/Shellink
2•jie123108•20m ago•0 comments

Viking 1 landed on Mars 50 years ago

https://www.theregister.com/science/2026/07/21/viking-1-landed-on-mars-50-years-ago/5275041
2•YeGoblynQueenne•20m ago•0 comments

Embedding status posts from another Bearblog

https://departure.blog/embedding-status-posts-from-another-bearblog/
1•surprisetalk•20m ago•0 comments

Chinese LLMs write more vulnerable code when prompted as U.S. officials

https://www.boozallen.com/expertise/cybersecurity/whats-in-americas-code.html
2•talhof8•23m ago•1 comments