2 ms·
If you live in Erlang for a while, you'll come to terms with recursion for loops. It's kind of weird to start with, but you get used to it. Kind of the same thi
by toast0 4y ago
If you live in Erlang for a while, you'll come to terms with recursion for loops. It's kind of weird to start with, but you get used to it. Kind of the same thing with the rest of the syntax issues. Of course, I wanted Erlang with nicer syntax, but then they gave me Elixir, which is worse (IMHO), so be careful what you ask for.
Immutable data is a key simplifying assumption of the VM though, and you can't write traditional loops without mutating some data, so there you go. Yes, sometimes the VM cheats a bit and mutates some data here and there, especially if you do stuff with the process dictionary, but you can't make self-referential data structures, which keeps GC simple.