by adrianratnapala · 9y ago · 0 comments
C is what it is partly because of its relationship with Unix, and also because it was the language that gave most straightforward access to "the machine" -- whatever that is.
And the hard truth is that The Machine was the only real universal platform around. But now we have this thing called The Web, which is not quite as universal but is getting there, and is much more like a single platform. JS has a special relationship with it.
The only thing that might upset this JS+Web applecart is WebAssembly. A "C of the Web" (call it W) would be a language high level enough to be pleasant to use, but which would have little or no runtime beyond what is native to WebAsm, and thus anyone could use libraries written in W.
People will use C or Python or whatever on the web for the same reasons so many people transpile to javascript today, including that they simply don't like javascript and would rather write code in a language they prefer.
But on the web, the basic "built-in" run-time is much richer than was available to those languages. It includes the DOM and many other things. JavaScript already exposes all those things, and no more, so I think it is ideally placed to become (remain) the dominant lingua franca.
So even if the WASM world is multi-lingual, expect APIs to be described in JS terms, maybe with some kind of backward-compatible type decoration thrown in.
Not the mention everywhere else it's been used - WebAssembly definitely isn't replacing Node.js, for instance, or game scripting.
WebAssembly is certainly able to replace JS in game scripting.
You're probably right, but egad, JavaScript is an even worse language than C. It's like jumping from the frying pan into the fire.
At least it's garbage-collected.