3 ms·
Few quick points Erlang doesn't have threads - it has processes. Thread's share state, processes don't. The processes are created within the Erlang cluster - t
by gordonguthrie 14y ago
Few quick points
Erlang doesn't have threads - it has processes. Thread's share state, processes don't. The processes are created within the Erlang cluster - they can't be operating system processes because they might be running on a different instance of the operating system.
Try and Catch are actually very rare constructs in Erlang - usually only at the boundaries of the system with the rest of the world. In my 10 years experience there is about 1 try/catch per 20k - 25k lines of production code.
Erlang doesn't handle errors - you let your process crash and let OTP restart it.
The article seriously underestimates the importance of OTP.
An Operating System is a set of libraries that means your unwritten application can do things like write to persistent storage, speak to a network, run in a cronjob, have a GUI, etc, etc...
To have a reliable computer system you need at least 2 computers and OTP is an Application System than runs across multiple physical boxes. This means that your unwritten software can failover if a box dies, recover in the presence of gross errors, cluster up, etc, etc... (Google App Engine is another example of an A/S).
The first cluster we ever deployed was a shambles. We moved a webserver from a London box to a Californian one and its performance went through the floor. Because of a typo we had actually only moved the web bit leaving the database running in London.
- rdtsc 14y ago> Thread's share state, processes don't. Not only that they also have separate heaps -- truly concurrent GC is possible without too much "clever" code.