3 ms·
Very cool! However, could they not compile the Haskell Elm compiler to JS using GHCJS and then write Elm bindings for it?
by de_keyboard 5y ago
Very cool! However, could they not compile the Haskell Elm compiler to JS using GHCJS and then write Elm bindings for it?
- raffomania 5y agoOne of their stated goals is to show people how to write a compiler in Elm, and another is to allow programmers familiar with Elm to hack on the Elm compiler without needing to learn Haskell.
- pd-andy 5y agoThe compiler written in Haskell relies on some extensions and/or optimisation tricks that make it not possible to compile with GHCJS. The 0.18 compiler (or maybe it was 0.17) was compiled with it though, it was what Ellie (third-party online playground) used.
- mjaniczek 5y agoOne thing to note is that writing the compiler in Elm instead of just compiling the Haskell compiler to JS allows us to expose bits of the compiler as an Elm library. I mean, being able to bootstrap is nice and nerdy and so on, but I believe exposing the parser, optimizer, type inference etc. as standalone functions will be the most impactful aspect of the repo, in terms of enabling better tooling in the Elm ecosystem.