4 ms·
JavaScript being garbage-collected, having a rather complex runtime, not having proper integers etc... makes it a rather unfortunate compile target. Yes you can
by laszlokorte 5y ago
JavaScript being garbage-collected, having a rather complex runtime, not having proper integers etc... makes it a rather unfortunate compile target. Yes you can do it and it is done but js idiosyncrasies leak into the source langues pretty easily.
- eatonphil 5y agoThat's a good argument but more of a maintainer argument than a user argument. From a user it should be transparent except for performance and FFIs.
- laszlokorte 5y agoWell the user perspective is: suddenly there a compilers for all kind of languages targetting the browser because wasm makes it easier for the maintainers to build them. Sure you could have implemented unsigned integer semantics on top of bool-arrays in javascript years ago but if the result is too slow you have gained because the compiled c++ code does not run fast enough to be usable.
- josephg 5y agoRegarding numbers, Javascript supports bigints now - which makes the situation a little bit better. (But maybe a lot more complex). I wish they were somehow better supported by JSON.parse though. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...