Hacker News new | past | comments | ask | show | jobs | submit login
List of languages that compile to JavaScript (github.com/jashkenas)
10 points by philonoist on Jan 15, 2023 | hide | past | favorite | 6 comments



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.



It'd be more interesting a Webasm list...if you have to compile, compile to the metal.


May I ask why is webasm not eating the market?

I mean what are the impediments do improvements like compiling to the metal make?


My understanding is Webasm is not finalised, never heard claims putting the doubt on it...though i'm all ears if people disagree


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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: