News for hackers. Stuff that matters.
Re:Caramel: an Erlang back end for OCaml by dynamite-ready on Sunday September 27, 2020 @07:57AM (#24605967)
What is it about Erlang's AST, that attracts so many language designers?
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).

As an example of recent amazing changes to the BEAM: JIT to x86_64 https://github.com/erlang/otp/pull/2745

Re:Caramel: an Erlang back end for OCaml by rkangel on Sunday September 27, 2020 @08:25AM (#24606122)
The BEAM provides an unmatched concurrency model and related infrastructure. Targeting a language at it gets you all the benefits of that language plus all of the fundamental work done to build distributed systems.

Another way of looking at it: almost nothing that is important or wonderful about writing Erlang is the language itself. Most of what people rave about is the BEAM. This means you can fairly easily throw out the language and use a different one and get all the benefit.

Now that I'm thinking about it - that last point is a spectacular achievement of design and abstraction.

Re:Caramel: an Erlang back end for OCaml by laser on Sunday September 27, 2020 @08:21AM (#24606105)
Perhaps it's a lot more than the AST that's attracting them? Like maybe the actor model (genservers)? Or OTP overall as a great platform for building self-healing, fast, distributed, functional systems? Or Immutability? There's lots of things to like about building on a foundation like Erlang.
Re:Caramel: an Erlang back end for OCaml by marianoguerra on Sunday September 27, 2020 @08:54AM (#24606275)
The target language is really simple and all the tooling for the erlang compiler itself is in the standard library.

so it's easy to get started, easy to get something usable quick and easy to see how it's used in real stuff.

Re:Caramel: an Erlang back end for OCaml by miloandmilk on Sunday September 27, 2020 @08:18AM (#24606086)
Not an expert - so just a guess, might be more to do with the advantages the BEAM provides?