Re:Ask HN: Why didn't the early web support more client side...
by goatlover on Friday July 30, 2021 @10:46PM
(#28014791)
WebAssembly is a much better target for compiled languages. And JS runs anywhere in the same way that Java does, which is wherever someone has installed a virtual machine for it, which is usually a web browser or Node for JS. But it doesn't run on more places than C or C++, which can be compiled to run on almost any hardware in existence.
Re:Ask HN: Why didn't the early web support more client side...
by brundolf on Friday July 30, 2021 @11:13PM
(#28014935)
> WebAssembly is a much better target for compiled languages
Depends on what you're trying to do. My language projects are almost always higher-level and garbage-collected, so again, targeting WASM would mean re-implementing fundamentals from scratch all the time. I'm glad to focus instead on interesting language features, translating those to be in terms of JS features.
And ClojureScript, and PureScript, and Elm, etc
Honestly, in my hobbyist experience, JavaScript is a joy to use as a compilation target. All the flexibility and the laundry list of features which can make it a handful to use directly, make it a wonderful base for nearly any kind of language you can imagine. And because it's higher-level, you can focus your energy on your own language instead of on re-implementing the fundamentals from scratch. And then of course it performs better than most similarly-flexible languages, and runs anywhere.