Re:Caramel: an Erlang back end for OCaml
by sigwinch28 on Sunday September 27, 2020 @08:19AM
(#24606091)
I don't think it's the AST: I think it's the BEAM itself.
The intermediate representations used in (and even accepted as input formats by) the compiler are relatively unstable, with the exception of the Erlang Abstract Format.
This makes it a great target for other compilers because they don't have to track breaking changes to the intermediate formats, they don't have to worry about generating BEAM bytecode, and they get to take advantage of all optimisations already implemented in erlc (the Erlang compiler).
The intermediate representations used in (and even accepted as input formats by) the compiler are relatively unstable, with the exception of the Erlang Abstract Format.
This makes it a great target for other compilers because they don't have to track breaking changes to the intermediate formats, they don't have to worry about generating BEAM bytecode, and they get to take advantage of all optimisations already implemented in erlc (the Erlang compiler).
As an example of recent amazing changes to the BEAM: JIT to x86_64 https://github.com/erlang/otp/pull/2745