News for hackers. Stuff that matters.
Re:Such a Little Thing: The Semicolon in Rust by Dobbs on Thursday October 18, 2012 @07:07PM (#4671516)
I'd rather have significant semi-colons than significant whitespace[1]. Don't mix presentation and semantics.

1: http://c2.com/cgi/wiki?SyntacticallySignificantWhitespaceCon...

Re:Such a Little Thing: The Semicolon in Rust by orlandu63 on Thursday October 18, 2012 @08:50PM (#4671775)
I'd rather have the ability to choose between and freely mix significant whitespace and significant semi-colons within a single source file.
Re:Such a Little Thing: The Semicolon in Rust by lmm on Friday October 19, 2012 @05:24AM (#4672821)
No you wouldn't. See Javascript for all the pain that causes. Language syntax needs to be dictatorial so that the language is consistent for reading (which is more important than writing).
Re:Such a Little Thing: The Semicolon in Rust by joeyespo on Sunday October 21, 2012 @03:59PM (#4680602)
JavaScript's problem isn't that you can choose whether or not to use semicolons, it's that they're automatically put in for you if you omit them.

http://lucumr.pocoo.org/2011/2/6/automatic-semicolon-inserti...

Technically, Python is a much better example of optional semicolons since you can use them and they're not required. Of course, the real reason they exist is for compound statements.

http://stackoverflow.com/questions/8236380/why-is-semicolon-...

Re:Such a Little Thing: The Semicolon in Rust by lucian1900 on Thursday October 18, 2012 @07:25PM (#4671567)
Just like Python, Haskell only ever has significant indentation.
Re:Such a Little Thing: The Semicolon in Rust by eridius on Thursday October 18, 2012 @07:48PM (#4671637)
Untrue. While it's true that most people use the 'layout' rule, which is the significant whitespace, there is a non-whitespace-significant variant that uses braces and semicolons. You can see an example of how layout is expanded to the alternative syntax at http://www.haskell.org/onlinereport/lexemes.html#lexemes-lay...
Re:Such a Little Thing: The Semicolon in Rust by lucian1900 on Friday October 19, 2012 @04:06AM (#4672668)
No, I meant that Haskell doesn't consider any whitespace that isn't indentation as significant.
Re:Such a Little Thing: The Semicolon in Rust by eridius on Friday October 19, 2012 @04:49AM (#4672752)
Very few languages consider non-indentation whitespace as significant (not counting using whitespace as a token delimiter, which Haskell definitely does, e.g. "foo bar" =/= "foobar").
Re:Such a Little Thing: The Semicolon in Rust by the_mitsuhiko on Friday October 19, 2012 @05:57AM (#4672878)
Ruby and CoffeeScript do and their syntax relies heavily on it.
Re:Such a Little Thing: The Semicolon in Rust by vidarh on Friday October 19, 2012 @08:27AM (#4673183)
For Ruby at least "heavily" is a big exaggeration. It is significant as a token separator and in cases where inserting a line break makes the expression up to the line break a valid expression in itself, in which case it is treated as one.

You pretty much only need to remember to separate tokens where lack of whitespace might create a different vald token, and ensure any expressions that you want to let span more than one line ends with something that expects following tokens to make a complete expression.

Personally I can live with that easily. I can not live with significant indentation, on the other hand...

Re:Such a Little Thing: The Semicolon in Rust by the_mitsuhiko on Friday October 19, 2012 @12:57PM (#4674357)
`foo()` and `foo ()` are different things in ruby, so are `foo[x]` and `foo [x]`. That is significant whitespace.
Re:Such a Little Thing: The Semicolon in Rust by lucian1900 on Friday October 19, 2012 @05:21AM (#4672817)
Yes, but many people assume whitespace everywhere will matter when they hear Python's offside rule described. It's a misconception I've found is worth dispelling, since almost no one minds meaningful indentation.