compiler icon indicating copy to clipboard operation
compiler copied to clipboard

Usecase: elmsl (Elm to Rust serverless apps)

Open tamagottschi opened this issue 6 years ago • 2 comments

Hi, I'm looking forward to use parts of your libraries (AST, type infer, optimize) to implement my elmsl compiler (elm serverless), which will be implemented in rust and create rust code.

tamagottschi avatar Jun 27 '19 12:06 tamagottschi

@tamagottschi what I read from this is that in addition to the AST, type inference and optimizations being exposed it would be good to have some kind of encoder / serializer for the AST, possibly to JSON? Would your tool consume that, or rather the resulting Elm source code? (In that case we would need an Elm emitter 😅 which is a good idea anyway probably.)

Janiczek avatar Jun 27 '19 13:06 Janiczek

After talking in person at Elm Europe 2019, I understand this as:

  • parts of elm-in-elm would be reimplemented in elmsl in Rust itself (the parts that are missing in elmsl) - elm-in-elm would be used as a reference implementation to look into; not used directly
  • in future elm-in-elm would compile itself into Rust :question: I'm a bit fuzzy about this one. (That would need Stage.Emit.Rust.emitExpr etc which doesn't exist right now)

So the answer to the JSON question is: no that is not needed.

Janiczek avatar Jun 28 '19 22:06 Janiczek