News for hackers. Stuff that matters.
Re:Dart language by maaku on Monday October 10, 2011 @04:09AM (#3092756)
they should not be mandatory
Re:Dart language by masklinn on Monday October 10, 2011 @04:22AM (#3092814)
If they're not mandatory, they should be out altogether unless required. Making them just optional is a path straight to js-land weird edge cases.
Re:Dart language by munificent on Monday October 10, 2011 @04:32AM (#3092859)
That's not true. Go, Python, Ruby and Scala all have optional semicolons without insanity. It's just that JavaScript's specific semantics for semicolon insertion (instead of newline elision!) are batshit crazy.
Re:Dart language by masklinn on Monday October 10, 2011 @04:50AM (#3092912)
> That's not true. Go, Python, Ruby and Scala all have optional semicolons without insanity.

Python (and Haskell) solve that issue by not using semicolons unless required. The Dart code in the examples is full of semicolons, that makes it an "optional semicolons language" akin to javascript more than a "possible semicolons language" akin to Python or Ruby.

Re:Dart language by munificent on Monday October 10, 2011 @07:05AM (#3093224)
> The Dart code in the examples is full of semicolons, that makes it an "optional semicolons language"

Well of course they do because semicolons are currently required, but that says nothing about its relationship to JavaScript's inane semicolon insertion semantics, and I'm pretty sure you're smart enough to know that. All Dart needs to do is:

1. Treat both newlines and semicolons as the same kind of token (call it whichever you like). 2. Pick an elision strategy. Go's or Python's work fine. 3. Remove all of the ";" from your source files.

No crazy JavaScript "rewind the parse and try again" insanity.

Re:Dart language by jmesserly on Monday October 10, 2011 @04:45AM (#3092896)
And pretty much all functional languages get by just fine without semicolons (Lisp, ML, Haskell, etc).
Re:Dart language by ErikCorry on Monday October 10, 2011 @06:24AM (#3093133)
ML uses semicolons.
Re:Dart language by dherman on Monday October 10, 2011 @09:30PM (#3096669)
I use semicolons pretty heavily in Lisp. ;)
Re:Dart language by dherman on Monday October 10, 2011 @11:46PM (#3097005)
Haskell has curly braces and semicolons.