5 ms·
An excellent answer. Although JS has problems, it did already win so Node.js is useful in that sense. But async everything is nutso and requires lots of gating
by dtagames 5y ago
An excellent answer.
Although JS has problems, it did already win so Node.js is useful in that sense. But async everything is nutso and requires lots of gating and checking mechanisms in order to get back to synchronous, imperative behavior which is what you normally want in a scripting language.
The setup/versioning and dependency hell issues of Node are absolutely bonkers. I work on a monrepo of 400,000 lines of code at work and I think most of the Node stuff is "just guessing" when people run it. Secret incantations that don't make any sense and have to be copy/pasted. All of Node is like this.
- Jensson 5y ago> Although JS has problems, it did already win In what way did it "win"? People use JS because it is in the browser, do you have any data that JS won anywhere except the browser? Pretty sure it isn't even the most popular solution for web backends.
- j4hdufd8 5y ago>Pretty sure it isn't even the most popular solution for web backends. Huh?
- 6510 5y agoI never got why there is just one. The script tag can take any number of languages.
- krapp 5y agoWhile support for multiple languages was the plan all along (the spec for the script tag mentions "text/tcl" along with javascript and vbscript)[0,1], browser makers never bothered to support other languages when javascript became the popular choice, apart from Microsoft with VBScript and Chrome with Dart, whose languages were vendor specific. Eventually, people just compiled code written in other languages into Javascript, treating it more as an "assembly language for the web"[2] than a language directly coded in, and the script type attribute was officially deprecated from the script tag in HTML5. [0]https://www.w3.org/TR/REC-html40/interact/scripts.html https://www.w3.org/TR/REC-html40/interact/scripts.html [1]https://eager.io/blog/a-brief-history-of-weird-scripting-languages/ https://eager.io/blog/a-brief-history-of-weird-scripting-lan... [2]https://www.hanselman.com/blog/javascript-is-assembly-language-for-the-web-sematic-markup-is-dead-clean-vs-machinecoded-html https://www.hanselman.com/blog/javascript-is-assembly-langua...
- 6510 5y agoWhat properties would a new language make an interesting alternative? What common problem suffers the most solved in js? Preferably something without hope for improvement.
- krapp 5y agoGiven how practically all Javascript nowadays is generated by Typescript or other compile-to-js languages, probably a stricter type system, actual integers and doubles (JS only uses floats,) maybe as often mentioned, a bigger standard library. There probably isn't much benefit to different languages if you're just manipulating the DOM (which is probably why that model failed, having more than one language doing the exact same thing is needless extra complexity) but using the browser as an application runtime opens up the possibility of making any software written in a supported language accessible and executable from a URL. The "JS as bytecode" model got us surprisingly far, but it was a disgusting hack, and Java applets and Flash had their day in the sun, but Webassembly is probably what's going to make the "multiple scripts in the browser" model eventually feasible.
- 6510 5y agoThinking about it there are so many angles from which one could approach it. It could not be required to run the script. For example require the visitor has his own website and have the script interact with specified tools installed there. Or a very limited language that disables js for security. It could be a highly readable DSL, for example something to write interpreters in. Or something narrow like interact with a rich text editor or data visualizations. Perhaps a basic game engine.
- oweiler 5y agoIt's also the most popular language for Lambda functions on AWS.
- Jensson 5y agoLambda functions are just a back end framework tightly coupled to a cloud service, they go in the web backend bin and aren't their own thing. Javascript might be the most popular there but I doubt lambda functions makes a significant dent in the overall web backend landscape.
- smitty1e 5y agoThat's a tarted-up container environment, irrelevant to node.js as such.