←back to thread

206 points weatherlight | 1 comments | | HN request time: 0.001s | source
Show context
hoppp ◴[] No.45101836[source]
Pretty cool. I am a fan of everything Erlang. Managing large clusters of IOT devices running Beam sounds like a good idea not just because of fault tolerance but for hot swapping code.
replies(2): >>45102376 #>>45102749 #
garbthetill ◴[] No.45102749[source]
I am the same but for elixir, the beam is awesome & I always wonder why it still hasn't caught on with all the success stories. The actor model just makes programming feel so simple
replies(2): >>45102907 #>>45103993 #
zwnow ◴[] No.45103993[source]
For me its the complete opposite of simple. I am a fan of BEAM and OTP but im a horrible programmer. I have constant fear of having picked the wrong restart strategy in a supervisor. Or about ghost processes or whatever. I have no mentors and learn everything myself. I have no way of actually checking whether my implementations are good. With my skills id manage to make an Elixir system brittle because its not clear to me what happens at all times.
replies(2): >>45104805 #>>45108195 #
1. toast0 ◴[] No.45104805[source]
WhatsApp did what it did and we didn't hire anyone who had experience with OTP until 2013 I think. One person who was very experienced in Erlang showed up for a week and bounced.

We were doing all sorts of things wrong and not idiomatically, but things turned out ok for the most part.

The fun thing with restart strategies is if your process fails quickly, you get into restart escalation, were your supervisor restarts because you restarted too many times, and so on and then beam shuts down. But that happens once or twice and you figure out how to avoid it (I usually put a 1 second sleep at startup in my crashy processes, lol).

Ghost processes are easy-ish to find. erlang:processes() lists all the pids, and then you can use erlang:process_info() to get information about them... We would dump stats on processes to a log once a minute or so, with some filtering to avoid massive log spew. Those kinds of things can be built up over time... the nice thing is the debug shell can see everything, but you do need to learn the things to look for.