To be a strong candidate for a web scripting language you need three things:
* native lexical scope. This is how all web technologies work.
* Minimal reliance on white space as syntax. The language needs to be portable. Overloading white space as syntax makes a language more brittle, particularly in distribution.
* Immediate interpretation without a prior static compile step. This keeps the code open to examination and minimizes compile time delays.
Find another language that doesn't have all the stupid crap that JavaScript has and yet still excels in those three points and I will agree upon a replacement.
How about Lua?
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.
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...