Elm compiler in Elm?

As of 2017, although the official compiler remains the only complete Elm compiler as far as I know, this has been converted to JavaScript, meaning it can now be run from Elm and in the browser. This means the major advantage described above of writing the Elm compiler in Elm now seems less relevant. You can see an example of how this has been used to compile Elm in the browser here.


At the moment the only complete Elm compiler is the "official" one, therefore not named, and it's written in Haskell. I don't know of any implementation of an Elm compiler in Elm.

Over the years that I've read the Elm mailing list(s) I've seen this question come up. Some people expressed interest in having the compiler written in Elm so it can be compiled to JavaScript, and therefore there would be a compiler for Elm in the browser. But so far that's the only compelling argument that's been brought up (IIRC). Which is not enough to make porting the Elm compiler to Elm a priority, the cost-benefit ratio is skewed by the huge effort it would take to port even half of the Haskell libraries that are currently used by elm-compiler.


There is a start in that direction, with an Elm parser written in Elm (although not updated yet to 0.18)

Tags:

Elm