It would be great if the list could rank how "well" these languages compile to JavaScript along some metrics:
- How much functionality remains in JavaScript vs the most-supported platform
- How many language bugs there are in JavaScript vs the most-supported platform by running a large testsuite (e.g. all tests of all public packages)
- How large the JS "binary" is, how long it takes to load (many languages put their entire VM into the JavaScript)
- How well the language interops with HTML / DOM (can you make usable websites with it? How about static sites with embedded content as opposed to React-style webapps?)
- How well the language interops with JavaScript libraries (npm)
Because there are a lot of languages which claim to compile to JavaScript but my experience is that many are unfortunately not practical due to issues with the above.
By far the most popular JS-target language is TypeScript, in part because it integrates very seamlessly being essentially JavaScript with optional type annotations. There are other contenders which also integrate well enough to be practical and which are used in large-scale projects (Elm, Scala.js, Dart). But I know that some the languages and compiling tools listed don't work very well and have major limitations.
One of the major reasons (other than the fact that it isn't finalized) is the lack of a way to interact with the DOM or other external memory models. There is work currently being done here but for now, anything you write with Wasm needs to have hooks out in to the real world and the serialization in and out of Wasm world is expensive
- How much functionality remains in JavaScript vs the most-supported platform
- How many language bugs there are in JavaScript vs the most-supported platform by running a large testsuite (e.g. all tests of all public packages)
- How large the JS "binary" is, how long it takes to load (many languages put their entire VM into the JavaScript)
- How well the language interops with HTML / DOM (can you make usable websites with it? How about static sites with embedded content as opposed to React-style webapps?)
- How well the language interops with JavaScript libraries (npm)
Because there are a lot of languages which claim to compile to JavaScript but my experience is that many are unfortunately not practical due to issues with the above.
By far the most popular JS-target language is TypeScript, in part because it integrates very seamlessly being essentially JavaScript with optional type annotations. There are other contenders which also integrate well enough to be practical and which are used in large-scale projects (Elm, Scala.js, Dart). But I know that some the languages and compiling tools listed don't work very well and have major limitations.