Why and How I Switched from Python to Erlang
I use both Python and Erlang. Python is to get small stuff done quickly language for me. And &quot;small&quot; doesn&#x27;t have to be just a demo or hello_world example, it can be a whole full back-end of a business.<p>(And btw when I say Erlang I also mean Elixir, they both share the same VM so most things apply to both).<p>But Erlang is a the secret sauce (so to speak) for a high concurrency fault tolerant backend. &quot;Fault tolerant&quot; should probably go first. The reason is the observation that the higher the concurrency or complexity in the system, the higher the need for fault tolerance. If you only serve 10 connections and the backend segfaults, 10 clients have lost connectivity, you get 10 angry phone calls. If you serve 1M connections and your backend segfaults, you get 1M phone calls. Exaggerating here of course to get the idea across. But this is not just a marketing gimmick, this translates to money in the pocket in operational costs. Some subsystem crashes and restarts? Fine, let it do that if it is 4am, no need to wake people up, will fix in the morning. I&#x27;ve heard of stories of subsystems crashing and restarting for years with the main service staying up.<p>The lack of centralized state might seem minor but unless you have been debugging a shared memory systems with locks, threads and manual memory allocations, with classes that have pages of attributes defined, and trying to understand why it crashes on Wednesdays only at customer A&#x27;s site, it is easy to miss the benefit. This comes through using small lightweight processes with an isolated heap and also using functional constructs.<p>Then in general, the ability to reason about concurrency using OTP constructs (Erlang&#x27;s standard library) and processes is like going from Assembly to C in terms of distributed and concurrent systems. Can express ideas at a higher level. This means having less code to look through and maintain.<p>There are other niceties like good garbage collection performance, awesome tracing and hot code loading capability (used this a few times, so started to appreciate it more now).<p>Now, individually all of those features can probably be found in other systems and frameworks, but they are just not integrated or not quite there -- Java has code loading but it is not the same. Can always spawn an OS process to get fault tolerance, but can only spawn so many before system falls down, Go has goroutines but they also share memory, so fault tolerance is not there. Other languages have garbage collection, but most still have to stop the world sometimes and so on.