This I'll never understand. Why, for god sake why, did he had to create such a terrible scripting language while he had plenty of great open source existing ones ? I mean:
- lua appeared 2 years before
- python 5 years before
- perl 7 years
Instead we have this monstrosity with no namespace, terrible error handling, pitiful stdlib, limited expressiveness, atrocious data structure and type handling, so full of traps and gotchas we had to write a book about the part of the languages not to use.
I've read that he'd wanted to just use Scheme, but that they needed the language to have "Java" in the name, as well as curly braces. So, we got Javascript.
Lastly, because S-expressions can represent everything that is representable in SGML/XML/(X)HTML, but more succinctly, we could have basically had Scheme instead of HTML.
Imagine if, instead of JS/HTML/CSS, we had... Scheme. I'm pretty sure that the alter universes where this happened also all have peace, warp drives, and working cold fusion.
> Lastly, because S-expressions can represent everything that is representable in SGML/XML/(X)HTML, but more succinctly, we could have basically had Scheme instead of HTML.
I suggest (along with David Moon (Lisp Machine)) that a key disadvantage of sexp with respect to *ML, is that there's no place to hang on "extra stuff". Many lisps allow you to decorate the nodes with properties once the nodes are read, but the properties lack a printed representation. It's a homoiconicity fail. Sort of like not allowing comments in JSON might be, if a common case was then to attach comments to the objects after they're loaded. That very isn't common, so the restrictiveness is worth it. It's not clear that's the case with sexp.
Considering the language was first called Mocha and then Livescript, "Java in the name" was not a requirement - it's just that OO and Java were all the rage at the time, so they followed the fashion.
The worst crime Sun ever committed will turn out to be influencing the birth of JS.
Glibly listing unsafe languages that would have been crippled and flash-frozen if (impossible in the time allotted) jammed into Netscape 2 caused me to find this old comment for you:
Lua is another thing that shouldn't really have happened, since Tcl already better served its niche. Sometimes it's like the whole tech industry is sleepwalking backwards.
Lua was successful for good reasons. And Lua itself acknowledged Tcl, but didn't have the right trade offs for them.
"In 1993, the only real contender was Tcl, which had been explicitly designed to be embedded into applications. However, Tcl had unfamiliar syntax, did not offer good support for data description, and ran only on Unix platforms. We did not consider LISP or Scheme because of their unfriendly syntax. Python was still in its infancy. In the free, do-it-yourself atmosphere that then reigned in Tecgraf, it was quite natural that we should try to develop our own scripting language ... Because many potential users of the language were not professional programmers, the language should avoid cryptic syntax and semantics. The implementation of the new language should be highly portable, because Tecgraf's clients had a very diverse collection of computer platforms. Finally, since we expected that other Tecgraf products would also need to embed a scripting language, the new language should follow the example of SOL and be provided as a library with a C API."
Come on, much that I like playing with Tcl, the programmers world is a better place because of Lua/LuaJIT. If for nothing else but a pedagogic demonstration of a well designed small language.
- lua appeared 2 years before
- python 5 years before
- perl 7 years
Instead we have this monstrosity with no namespace, terrible error handling, pitiful stdlib, limited expressiveness, atrocious data structure and type handling, so full of traps and gotchas we had to write a book about the part of the languages not to use.