3 ms·
Blame the browser. If Brendan Eich had tried to repurpose an existing language instead of mashing together a new one; or if Microsoft had used their de-facto mo
by toyg 9y ago
Blame the browser. If Brendan Eich had tried to repurpose an existing language instead of mashing together a new one; or if Microsoft had used their de-facto monopoly in early '00 to push abetter language, JS wouldn't be as big as it is today.
- gaius 9y agoSometimes it seems as if every project is either a) everyone's first in a brand new language or b) maintaining a project that was everyone's first in a brand new language. How can we actually make progress like this?
- robotresearcher 9y agoThe youngest of C, C++, Java, Python and Javascript is 21 years old. I bet these cover most new and old projects between them.
- sametmax 9y agoThis 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.
- peatmoss 9y agoI'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. Also, given that DSSSL was an early contender against CSS (and a great deal more powerful), we could have basically had Scheme there too. https://blog.cloudflare.com/the-languages-which-almost-became-css/?f https://blog.cloudflare.com/the-languages-which-almost-becam... 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.
- abecedarius 9y agoSome MIT people in the 90s tried to do approximately that with a new language they called Curl. But it was proprietary until too late.
- sametmax 9y agoWell fork Lua, call the fork JavaStuff and be done with it. How can anybody think it's a good idea to create a language in 2 weeks and call it a day ?
- mncharity 9y ago> 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.
- toyg 9y agoConsidering 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.
- scriptproof 9y agoAnd now WebAssembly is made of s-expressions (in textual form). If you are right, I am curious of what will be the future of the web.
- gaius 9y agoLua 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.
- dottrap 9y agoLua 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." http://www.lua.org/doc/hopl.pdf http://www.lua.org/doc/hopl.pdf
- srean 9y agoCome 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.
- BrendanEich 9y agoGlibly 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: https://news.ycombinator.com/item?id=1905155 https://news.ycombinator.com/item?id=1905155 Do you actually use JS? What's with the royal "we" that only His Majesty King Crockford (I'm friendly with Doug) can use?
- yjftsjthsd-h 9y ago> if Microsoft had used their de-facto monopoly in early '00 to push abetter language For all that JS may suck, I somehow think anything early 2000s MS would have pushed would have been worse. VBscript, perhaps?
- toyg 9y agoAt that time they already had C#, so it's not impossible to believe they could have done better than vbs. The real problem would have been that they would have had to give other browsers a chance to adopt the new language, possibly even by providing dedicated resources to implement it for them; but Ballmer's MS didn't really "do" cooperation, they were happy to push ActiveX to lock out competitors. Still, they did have the chance.
- BrendanEich 9y agoStudy history or you, too, may be doomed to repeat it: https://devchat.tv/js-jabber/124-jsj-the-origin-of-javascript-with-brendan-eich https://devchat.tv/js-jabber/124-jsj-the-origin-of-javascrip... (transcript at bottom) https://brendaneich.com/2012/04/the-infernal-semicolon/#comment-1133 https://brendaneich.com/2012/04/the-infernal-semicolon/#comm... Netscape management gave "make it look like Java" orders. There was no time, on top of this. Last (more below in another reply) no extant command line interpreter was ready to be put in a browser. Way too many non-portable OS dependencies, unsafe FFI, etc. It was JS or bust (aka VBScript).