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

Ok let's talk concrete implementation.

Rust: https://github.com/pingcap/raft-rs LOC: 15417

Erlang: https://github.com/rabbitmq/ra LOC: 18012

Lines of code is not the only metric. I'm actually really curious about Erlang and Elixir but to be honest I do like type systems a lot. I also like the idea of idk...having one language for my os, db, front-end.




Unfortunately I can't show you my code since it's closed. Just looking at the two codebases, about half of the erlang implementation is static typechecking hints, and I don't know if GitHub counts the documentation HTML as LOC.

As an example of convenient concurrency, in Erlang vm gives you process node id translation. What that means is that if you're sending a message between threads in two instances in a cluster of VMs, you can send your the mailbox address of your local thread and have it converted on transmit to the equivalent remote thread address on the remote machine. Literally one less thing you don't have to worry about, and clustering is a first class citizen in the language, no libraries necessary.

Basically, the dev process was, I wrote my raft implementation, tested it locally and extensively (including property tests) using multiple local threads, and did almost nothing (three lines of code to provide a mailbox Oracle) and had a solution that worked across the network.

If you're curious about BEAM languages, I wouldn't worry about type systems. If anything I think hypercorrectness in the languages leads to a false sense of comfort about the quality of your code that can get in the way of building resilient, designed to fail gracefully systems. Typechecking can catch errors early and save you dev and debug time, but static typechecking is probably enough for about 80% of those concerns.

Erlang languages come with static typechecking. It's kind of a pain in the butt out of the box. I don't know about erlang, but if you code in vscode, the elixir_ls plugin engages the static typechecking in such a transparent fashion that I've forgotten to install the makes-static-typechecker-easier library and it's caught code problems for my junior dev (who I haven't taught typechecking yet). Despite it being optional in the language, the vscode plugin makes it ever so ugly to not annotate types that my very minor obsessive tendencies lead me to annotate everything.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: