4 ms·
1. Bring everything down? 2. Try to capture the error and recover? 3. Kill the crashed process and launch another one in its place? For example, C uses ap
by avodonosov 10y ago
1. Bring everything down?
2. Try to capture the error and recover?
3. Kill the crashed process and launch another one in its place?
For example, C uses approach 1. Most modern languages
with Exceptions like Java and Python use 2.
No, in Java and C the "let it crash" (aka the "failstop principle") is also used.
- avodonosov 10y agoIn C the OS process takes place of the Erlang "process". C is designed for multi-process systems (Unix), where a task is often implemented by a number of processes. Upon error the process is terminated, but the system (OS) is never "brought down" by a single failure, remains fully operational and you can retry your command again.
- honua 10y agoWhile similar, it's not the same. Erlang/OTP/Elixir provides baked in tools to watch, restart, etc. processes. In C you'd need to do this yourself.
- avodonosov 10y agoThe tools to watch, restart, etc are bash, ps, top, etc
- dozzie 10y agoNot really. Those are equivalent to monitors and links in Erlang/BEAM, if we go this line of thought. OTP is a collection of architectural patterns coded down in Erlang (what means OTP is a framework).
- avodonosov 10y agoWe are talking about error handling. My point: "let it crash" aka "failstop principle" is well known for decades, and practiced in all major languages.
- dozzie 10y ago> We are talking about error handling. I thought we switched to a little more down-in-the-trenches discussion with you saying: > The tools to watch, restart, etc are bash, ps, top, etc
- avodonosov 10y agoCarried away a little. Not to say it's not interesting to compare Unix/C programs with OTP/Erlang, but it's a different subject.