Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Things like Erlang + C seem unlikely; their whole purposes are different.

Erlang and C are complimentary.

Erlang calls code written in NIFs, coordinates C Nodes, and/or programs talking to the emulator over ports.

The original design goal of Erlang was to make it easy to write correct, concurrent, fault-tolerant supervisors and coordinators for complex, high-performance systems. (Like suchas telecom switches.) Erlang wasn't intended to be particularly fast, but to make writing concurrent systems easy, and provide fairly low and fairly predictable latency. One bounces out to C for performance-critical stuff, rather than writing it in Erlang... even today.



Thanks for the explanation! I knew it focused on concurrency, but just assumed Erlang was another functional language. Your description makes me curious about it. Also makes me wonder how useful it would be as a systemd sort of thing, given your description as "supervisor and coordinator".


"1.4 What sort of problems is Erlang not particularly suitable for?"

https://www.erlang.org/faq/introduction.html


You could probably use Erlang (or any other BEAM language with access to OTP) as a service control system (like openrc, or systemd or similar), yeah.

But yeah, I find writing servers and other such systems with many moving parts that can be reasonably modeled as Actors passing messages between themselves in Erlang to be so, so, so enjoyable.

If you're interested in picking up the language, I'd recommend Learn You Some Erlang [0]. It's a bit out of date (for instance, it talks about "maps" as being a new thing that's being designed, but they've been in the language for ages), but it's still a really good introduction to the fundamentals of the language and its runtime system. Fred Hebert is generally a good technical writer, so taking a look through his blog is also generally recommended.

The Erlang docs are also good. The top-level directory is here [1], and you if you're not looking for desk reference docs, you might start reading at either "Getting Started" [2] or maybe "Design Principles" [3]. Learn You Some Erlang covers a fair bit of what's in those two sections, but sometimes it's helpful to see the same information written another way.

[0] <https://learnyousomeerlang.com/>

[1] <https://www.erlang.org/docs>

[2] <https://www.erlang.org/doc/system/getting_started.html>

[3] <https://www.erlang.org/doc/system/design_principles.html>




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: