frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

No Semicolons Needed

https://terts.dev/blog/no-semicolons-needed/
24•karakoram•3h ago

Comments

gcanyon•1h ago
Can anyone give a good reason why supporting syntax like:

    y = 2 * x
      - 3
is worth it?
whateveracct•1h ago
in Haskell, supporting that is how you get neat composition

such as applicative style formatted like this:

        f
    <$> x
    <*> y
    <*> z
szmarczak•1h ago
It's not. Your eyes can deceive you by guessing the correct indentation. Indentation should never be used for grammar separation. Explicit characters such as } ] ) are clearer and unambiguous.
bmandale•47m ago
Clearer for the computer, but not for the human. Many errors, some severe, have been caused by a human only looking at the indentation and not realizing the braces don't match.
szmarczak•35m ago
> human only looking at the indentation and not realizing the braces don't match.

If it ever gets to that point, a refactor is obligatory.

Don't give the human tools to make easy mistakes. Any grammar can be abused, so blame the human for not writing clean code.

marcosdumay•1h ago
By "is worth it" you mean it's worth the work?

Because it's very little extra work.

If you want to know if it's a good syntax, AFAIK it's the only way to do a semicolon-less language that doesn't break all the time.

justsomehnguy•57m ago
Mostly eye-candy, especially for some long one-liners.

In PowerShell you can do that by explicitly instructing what the next line is actually a continuation of the previous one:

    $y = 2 * $x `
       - 3
zephen•45m ago
Obviously, that's a really short expression.

So, the question is, if you have a long expression, should you have to worry too much about either adding parentheses, or making sure that your line break occurs inside a pair of parentheses.

It boils down to preference, but a language feature that supports whatever preference you have might be nice.

  priority = "URGENT"  if hours < 2  else
             "HIGH"    if hours < 24 else
             "MEDIUM"  if hours < 72 else
             "LOW"
marcosdumay•1h ago
Looks at 11 languages, ignores Haskell or anything really different...
librasteve•53m ago
or Raku
Animats•1h ago
Classic mistakes in language design that have to be fixed later.

- "We don't need any attributes", like "const" or "mut". This eventually gets retrofitted, as it was to C, but by then there is too much code without attributes in use. Defaulting to the less restrictive option gives trouble for decades.

- "We don't need a Boolean type". Just use integers. This tends to give trouble if the language has either implicit conversion or type inference. Also, people write "|" instead of "||", and it almost works. C and Python both retrofitted "bool". When the retrofit comes, you find that programs have "True", "true", and "TRUE", all user-defined.

Then there's the whole area around Null, Nil, nil, and Option. Does NULL == NULL? It doesn't in SQL.

sheept•1h ago
> I would love to see a language try to implement a rule where only an indented line is considered part of the previous expression.

Elm does this (so maybe Haskell too). For example

    x = "hello "
     ++ "world"

    y = "hello "
    ++ "world" -- problem
sheept•55m ago
Because formatters are increasingly popular, I think it'd be interesting to see a language that refuses to compile if the code is improperly formatted, and ships with a more tolerant formatter whose behavior can change from version to version. This way, the language can worry less about backwards compatibility or syntax edge cases, at the cost of taking away flexibility from its users.
librasteve•52m ago
This article makes a strong case for every language to use ‘;’ as a statement separator.
bmandale•49m ago
> I would love to see a language try to implement a rule where only an indented line is considered part of the previous expression.

After python, it seems like every language decided that making parsing depend on indents was a bad idea. A shame, because humans pretty much only go by indents. An example I've frequently run into is where I forget a closing curly brace. The error is reported at the end of the file, and gives me no advice on where to go looking for the typo. The location should be obvious, as it's at exactly the point where the indentation stops matching the braces. But the parser doesn't look at indents at all, so it can't tell me that.

vips7L•44m ago
Scala 3 decided to go with indents.
kayson•40m ago
I was much more opposed to this early on than I am now. With modern IDEs and extensions handling tabs vs spaces, tab width, and formatting, python ends up being very easy to read and write. I use it daily, and while I hate it for other reasons, I can't remember the last time I had any issues with indentation.
stinkbeetle•35m ago
> An example I've frequently run into is where I forget a closing curly brace. The error is reported at the end of the file, and gives me no advice on where to go looking for the typo. The location should be obvious, as it's at exactly the point where the indentation stops matching the braces. But the parser doesn't look at indents at all, so it can't tell me that.

That's somewhat a quality of service issue though. Compilers should look at where the braces go out of kilter vs indentation and suggest the possible unmatched opening brace.

IshKebab•46m ago
> how does Gleam determine that the expression continues on the second line?

The fact that it isn't obvious means the syntax is bad. Stuff this basic shouldn't be ambiguous.

> Go's lexer inserts a semicolon after the following tokens if they appear just before a newline ... [non-trivial list] ... Simple enough!

Again I beg to differ. Fundamentally it's just really difficult to make a rule that is actually simple, and lets you write code that you'd expect to work.

I think the author's indentation idea is fairly reasonable, though I think indentation sensitivity is pretty error-prone.

kayson•39m ago
Are we really saving that much by not having semicolons? IDEs could probably autocomplete this with high success, and it removes ambiguity from weird edge cases. On the other hand, I've not once had to think about where go is putting semicolons...
gethly•11m ago
garbage

Do Not Turn Child Protection into Internet Access Control

https://news.dyne.org/child-protection-is-not-access-control/
242•smartmic•2h ago•79 comments

Tinybox- offline AI device 120B parameters

https://tinygrad.org/#tinybox
195•albelfio•2h ago•115 comments

Some things just take time

https://lucumr.pocoo.org/2026/3/20/some-things-just-take-time/
434•vaylian•8h ago•147 comments

Professional video editing, right in the browser with WebGPU and WASM

https://tooscut.app/
39•mohebifar•1h ago•10 comments

Grafeo – A fast, lean, embeddable graph database built in Rust

https://grafeo.dev/
161•0x1997•8h ago•55 comments

Show HN: Termcraft – terminal-first 2D sandbox survival in Rust

https://github.com/pagel-s/termcraft
62•sebosch•4h ago•6 comments

Electronics for Kids, 2nd Edition

https://nostarch.com/electronics-for-kids-2e
54•0x54MUR41•2d ago•7 comments

The seven hour explosion nobody could explain

https://phys.org/news/2026-03-hour-explosion.html
71•mellosouls•4d ago•8 comments

How Invisalign became the biggest user of 3D printers

https://www.wired.com/story/how-invisalign-became-the-worlds-biggest-3d-printing-company/
115•mikhael•2d ago•81 comments

No Semicolons Needed

https://terts.dev/blog/no-semicolons-needed/
25•karakoram•3h ago•21 comments

No evidence cannabis helps anxiety, depression, or PTSD

https://www.sciencedaily.com/releases/2026/03/260319044656.htm
106•nothrowaways•2h ago•81 comments

Hide macOS Tahoe's Menu Icons

https://512pixels.net/2026/03/hide-macos-tahoes-menu-icons-with-this-one-simple-trick/
59•soheilpro•5h ago•16 comments

Common Lisp Development Tooling

https://www.creativetension.co/posts/common-lisp-development-tooling
20•0bytematt•2h ago•2 comments

The paddle wheel aircraft carriers of Lake Michigan

https://signoregalilei.com/2026/03/08/the-paddle-wheel-aircraft-carriers-of-lake-michigan/
20•surprisetalk•4d ago•2 comments

ZJIT removes redundant object loads and stores

https://railsatscale.com/2026-03-18-how-zjit-removes-redundant-object-loads-and-stores/
67•tekknolagi•3d ago•10 comments

Thinking Fast, Slow, and Artificial: How AI Is Reshaping Human Reasoning

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6097646
77•Anon84•7h ago•45 comments

Show HN: Atomic – self-hosted, semantically-connected personal knowledge base

https://github.com/kenforthewin/atomic
26•kenforthewin•3h ago•0 comments

Ubuntu 26.04 Ends 46 Years of Silent sudo Passwords

https://pbxscience.com/ubuntu-26-04-ends-46-years-of-silent-sudo-passwords/
290•akersten•17h ago•296 comments

Meta's Omnilingual MT for 1,600 Languages

https://ai.meta.com/research/publications/omnilingual-mt-machine-translation-for-1600-languages/?...
110•j0e1•3d ago•31 comments

Esqueleto Tutorial

https://entropicthoughts.com/esqueleto-tutorial
6•ibobev•4d ago•0 comments

A Japanese glossary of chopsticks faux pas (2022)

https://www.nippon.com/en/japan-data/h01362/
446•cainxinth•1d ago•345 comments

Hawaii's worst flooding in 20 years threatens dam, prompts evacuations

https://www.nbcnews.com/weather/floods/hawaii-worst-flooding-in-20-years-rcna264573
40•geox•3h ago•15 comments

Mamba-3

https://www.together.ai/blog/mamba-3
268•matt_d•4d ago•50 comments

Show HN: Joonote – A note-taking app on your lock screen and notification panel

https://joonote.com/
32•kilgarenone•7h ago•26 comments

Books of the Century by Le Monde

https://standardebooks.org/collections/le-mondes-100-books-of-the-century
87•zlu•2d ago•55 comments

FFmpeg 101 (2024)

https://blogs.igalia.com/llepage/ffmpeg-101/
203•vinhnx•20h ago•8 comments

OpenCode – Open source AI coding agent

https://opencode.ai/
1182•rbanffy•1d ago•578 comments

Blocking Internet Archive Won't Stop AI, but Will Erase Web's Historical Record

https://www.eff.org/deeplinks/2026/03/blocking-internet-archive-wont-stop-ai-it-will-erase-webs-h...
471•pabs3•15h ago•131 comments

A pig's brain has been frozen with its cellular activity locked in place

https://www.newscientist.com/article/2520204-major-leap-towards-reanimation-after-death-as-mammal...
96•Brajeshwar•8h ago•133 comments

Molly guard in reverse

https://unsung.aresluna.org/molly-guard-in-reverse/
204•surprisetalk•1d ago•83 comments