Hacker News new | ask | show | jobs
by nnevatie 115 days ago
BEAM/OTP are great, but do impose an exotic language onto the user. Most programs and solutions of today aren't Erlang-based.
3 comments

Any software developer worth hiring should be able to pick up a new language (especially one with as great learning materials as Elixir) and become productive in it in so little time that it's rounding error compared to the time to integrate into a new codebase and a new team.

This fear of better languages being some massive hurdle is either unfounded, or the big tech companies paying top dollar for talent aren't getting their money's worth.

Erlang is a pretty simple language, it's hardly "exotic". Any competent programmer should be able to pick it up in a short period of time, days to weeks. Now, how long to master the concurrency model, "let it crash" mindset, small processes, and supervisors? Maybe a bit longer.
Yeah, I meant this from the perspective that for example, I'd love to have that environment and approach in my sleeve, but utilizing C++ and all I have built using it.
I get it, but many of the guarantees the BEAM provides come from limitations imposed by BEAM languages.

BEAM provides effective preemption of processes by counting function calls made by the process; the is effectively preemptive, because BEAM languages require recursion to implement loops.

BEAM has a simple GC with one heap per process. This is made possible because BEAM languages have immutable variables which can only reference older variables; and data is copied to rather than shared with other processes. (Caveat: ets and shared heap refcounted binaries allow for sharing with some additional complexity in the GC)

One heap per process also enables process isolation and fast and simple destruction of processes.

It's hard to build a similarly constrainted environment in C++ and if you did, you would likely not be able to use a lot of existing code. Maybe you don't want GC anyway, and you could use OS process isolation, but I've run Erlang nodes with millions of processes, and I don't think that's feasible with OS processes.

Use Elixir. Not exotic at all.
And if you don't like that, you could try some other BEAM language https://github.com/stars/michallepicki/lists/beam-languages