New blog post!

I've been investigating out how various languages get away with not requiring semicolons.

I looked at 11 languages and found so many interesting cases I had to share!

https://terts.dev/blog/no-semicolons-needed/

#programming #roto

No Semicolons Needed | Terts Diepraam

@terts In your Gleam example with 1 + 1 1 + 1 here are some more interesting cases to consider:

1 + 1 -1 + 1 (two expressions)
1 + 1 - 1 + 1 (one expression)
1 + 1 -x + 1 (one expression)
1 + 1 - x + 1 (one expression)

I verified on the Gleam playground that this is indeed how they parse.

@terts IIRC, Swift has rules for "operator tokens" that take into account whitespace (and special delimiters) on the left and right side to determine prefix vs postfix vs infix uses, but it doesn't look like Gleam does anything like that. That is not a separable design issue because it interacts with how well "naturally ends" termination works out in practice.

@pervognsen That third Gleam case is...interesting 😄

I think I mention that rule that Swift has in the post!