3 ms·
There are plenty of languages that don’t require semicolons and yet manage to avoid those issues: Clojure, Go, Odin…
by christophilus 2y ago
There are plenty of languages that don’t require semicolons and yet manage to avoid those issues: Clojure, Go, Odin…
- jmyeet 2y agoClojure delineates everything by explicitly putting statements in parentheses (like any LISP). That's basically the same thing. Go is an interesting example but it gets away with this by being far stricter with syntax IIRC (for the record, I'm a fan of Go's opinionated formatting).
- scotty79 2y agoAlso Scala
- 9rx 2y agoFunny enough, Go’s grammar does require semicolons. It avoids needing them typed in the source code by automatically adding them on each newline before parsing.
- ropejumper 2y agoOn almost every newline, which is the reason why this doesn't work: func thing() { I quite like this approach. It's very simple and consistent, and once you know how it works it's not ever surprising.