20 ms·
This is some amazing progress, but reading this and hearing how difficult JavaScript is as a language to design around makes me wonder how many hours have we sp
by ryanong 9y ago
This is some amazing progress, but reading this and hearing how difficult JavaScript is as a language to design around makes me wonder how many hours have we spent optimizing a language designed in 2 weeks and living with those consequences. I wish we could version our JavaScript within a tag somehow so we could slowly deprecate code. I guess that would mean though browsers would have to support two languages that would suck..... this really is unfortunately the path of least resistance.
(I understand I could use elm, cjs, emscriptem or any other transpirer but I was thinking of ours spent around improving the js vm.
- exikyut 9y ago> I wish we could version our JavaScript within a tag somehow Behold one of the implementational details that emerged out of this language that was indeed "designed in 2 weeks": <script type="text/javascript1.0">...</script> <script type="text/javascript1.1">...</script> <script type="text/javascript1.2">...</script> <script type="text/javascript1.3">...</script> <script type="text/javascript1.4">...</script> <script type="text/javascript1.5">...</script> https://tools.ietf.org/html/rfc4329 https://tools.ietf.org/html/rfc4329: 3. Deployed Scripting Media Types and Compatibility Various unregistered media types have been used in an ad-hoc fashion to label and exchange programs written in ECMAScript and JavaScript. These include: +-----------------------------------------------------+ | text/javascript | text/ecmascript | | text/javascript1.0 | text/javascript1.1 | | text/javascript1.2 | text/javascript1.3 | | text/javascript1.4 | text/javascript1.5 | | text/jscript | text/livescript | | text/x-javascript | text/x-ecmascript | | application/x-javascript | application/x-ecmascript | | application/javascript | application/ecmascript | +-----------------------------------------------------+ https://www.quirksmode.org/js/intro.html https://www.quirksmode.org/js/intro.html (from circa 2007, when it was trendy to NOT date webpages shakes fist): > JavaScript versions > There have been several formal versions of JavaScript. > 1.0: Netscape 2 > 1.1: Netscape 3 and Explorer 3 (the latter has bad JavaScript support, regardless of its version) > 1.2: Early Version 4 browsers > 1.3: Later Version 4 browsers and Version 5 browsers > 1.4: Not used in browsers, only on Netscape servers > 1.5: Current version. > 2.0: Currently under development by Brendan Eich and others. The link above points to a bit of interesting general discussion about versioning, and isn't as dense as the RFC.
- ryanong 9y agoYea I remember that versioning but few browsers implemented it.
- bryanlarsen 9y agoAnother mechanism created to do something similar to versioning was strict mode.
- AgentME 9y agoAnd along these lines: javascript modules automatically turn strict mode on, so most people will just be on the "new" (strict) version of javascript once modules are popular.
- goatlover 9y agoBrendan Eich was on a podcast in 2016 talking about the origins and evolution of JS. At one point he and the ECMA team wanted to make == strict equality, but then that would have required specifying the JS version, and Microsoft didn't like that, so they decided to go with === and leave == non-strict. It's one of several cases where backward compatibility on the web trumped cleaning up the language.