logoalt Hacker News

zwnowlast Sunday at 6:28 AM2 repliesview on HN

This is funny given Elixir/Erlangs whole idea is "let it crash". In Go I just have a Recovery Middleware for any type of problem. Don't know how other langs do it tho


Replies

knomelast Sunday at 6:48 AM

erlang doesn't crash the program, it crashes the thread. erlang has a layered management system built in as part of OTP (open telecom platform, erlang was built for running highly concurrent telephony hardware). when a thread crashes, it dies and signals its parent. the parent then decides what to do. usually, that's just restarting the worker. maybe if ten workers have crashed in a minute, the manager itself will die and restart. issues bubble up, and managers restart subsystems automatically. for some things, like parsing user data, you might never cause the manager to die, and just always restart the worker.

the article, if you should choose to read it, is explaining that people have the misconception you appear to be having due to the 'let it fail' catchphrase. it goes into detail about this system, when failing is appropriate, and when trying to work around errors is appropriate.

as erlang uses greenthreads, restarting a thread for a user API is effectively instant and free.

show 1 reply
davidclarklast Sunday at 7:27 AM

I don’t know Go, but that sounds like someone has simply written part of Erlang in Go.