News for hackers. Stuff that matters.
Re:WebAssembly support now shipping in all major browsers by askvictor on Tuesday November 14, 2017 @04:55PM (#15699545)
While I don't agree with your second point, which seems to be there purely to exclude Python, I'll run with it so as not to devolve into religious war territory.

How about Lua?

Re:WebAssembly support now shipping in all major browsers by austincheney on Tuesday November 14, 2017 @06:19PM (#15700203)
A line terminator on *nix isn't a line terminator on Windows, which is a big deal if line termination ends a statement, and that assumes the file isn't modified in transit.
Re:WebAssembly support now shipping in all major browsers by int_19h on Tuesday November 14, 2017 @08:15PM (#15700778)
Yet somehow, Python doesn't have this problem - it simply treats both types of line terminators as valid. So do all other modern languages that rely on whitespace.
Re:WebAssembly support now shipping in all major browsers by askvictor on Tuesday November 14, 2017 @07:54PM (#15700679)
And semicolons are optional in JavaScript, makes it whitespace sensitive I suppose.
Re:WebAssembly support now shipping in all major browsers by austincheney on Tuesday November 14, 2017 @09:06PM (#15700951)
Yes and no.

The language specification requires the use of semicolons. If a semicolon is not supplied the interpreter will insert it for you. That magical insertion step is referred to as ASI. I don't remember if ASI is mentioned in the spec (as I don't think it is), but at the very least it is a de facto standard as missing ASI breaks the web.

As stupid as all that sounds... semicolons are actually required to terminate statements in JavaScript.

Re:WebAssembly support now shipping in all major browsers by askvictor on Tuesday November 14, 2017 @09:33PM (#15701052)
And yet somehow the web doesn't break when one programmer uses \r\n while another uses \n. What was your original point about line terminators in this context?
Re:WebAssembly support now shipping in all major browsers by austincheney on Wednesday November 15, 2017 @06:29AM (#15703022)
I suppose that goes to how the language defines line termination and whether that language is OS aware. JS is completely independent of its execution context. Python may achieve this as well, and if so, then I am wrong in my thoughts about Python.

Here is how JavaScript does this:

* https://www.ecma-international.org/ecma-262/#sec-source-text

* https://www.ecma-international.org/ecma-262/#sec-line-termin...

ASI is defined in the spec here: https://www.ecma-international.org/ecma-262/#sec-automatic-s...