schultzer
wk_end
Does Erlang/Elixer have any edge over Ocaml or Haskell in that niche? They also have pattern matching, of course, and strong static types tend to work nicely for compilers too.
Of course, the big superpower they have is the BEAM and the robust multiprocessing support there, but that’s not especially helpful for compilers…or is it?
Munksgaard
As someone who has used both SML, Haskell, Rust and Elixir professionally: No, not really.
Access to the BEAM is nice, but unless you're targeting the BEAM in your compiler I don't see any benefit. Even if you're targeting the BEAM, you might decide to use another language, cf. Gleam: https://github.com/gleam-lang/gleam/
Edit: Actually, one thing I will mention is the superior support in Elixir/Erlang for pattern matching bitstrings[0]. Not usually helpful in compilers, but an evolution of pattern matching that other languages should take up, in my opinion.
0: https://hexdocs.pm/elixir/Kernel.SpecialForms.html#%3C%3C%3E...
schultzer
Elixir compiler is written in Erlang, Erlang can produce very efficient code, the new json library can beat c libraries at decoding / encoding. And you get this with a strongly typed dynamic language, which is a distributed language. It’s really hard to beat the BEAM, if only we had better number crunching, but in so cases you can always write a nif.
dcsommer
"Strongly typed" is stretching it. Type checking is bolted on and not part of `erlc`. Typing is quite unergonomic in Erlang/Elixir (similar to Typescript bolted onto JS).
The type system is one of the weakest parts of the beam ecosystem.
xelxebar
Studying the BEAM is definitely on my ToDo list. It's task parallelism sounds exemplar, and I really want to understand the architectural ramifications of choosing fine-grained task parallelism vs. a data parallel-friendly approach.
troupo
I wish articles like this had more meat on why BEAM is good.
You have to say why it's good. E.g. https://news.ycombinator.com/item?id=28015852
brandonpollack2
If only there was a typed language that didn't hand wave serialization
mrkeen
I don't think we'll ever do better than 'IO is made out of bytes'.
One thing that is great about Erlang’s pattern matching is that it makes it extremely approachable for writing, lexer, parser and compilers in it: https://github.com/elixir-dbvisor/sql and with Elixir macros and sigils then you can embed other languages like sql and zig to name a few!