4 ms·
It's absolutely a feature. It allows testing small parts of a system during a major code change when the rest of the system is broken.
by tlb 13y ago
It's absolutely a feature. It allows testing small parts of a system during a major code change when the rest of the system is broken.
- kyllo 13y agoAs well as applying patches to a running system without restarting it
- tel 13y agoHaving done this both with Clojure and Erlang, I find the unversioned, dynamic mode of achieving this is fraught with trouble. It's really easy to end up in complex atypical states during upgrade which can at best be hard to debug and worst corrupt other, longer term state.
- jamii 13y agoExactly. I think what a lot of people miss is that erlang makes live upgrades possible but certainly not easy. Trying to upgrade a complex application one component at a time (the way erlang/otp promotes) is still insanely hard and not worth the pain unless you're working in a domain where you have absolutely no choice (which is of course why Ericsson developed erlang in the first place). For the vast majority of applications the right choice is to restart the server and accept a few seconds downtime.
- tel 13y agoI think with better documentation I'd actually call Erlang's model "easy" in that its really easy to do things correctly with absolutely minimum chance of corruption/failure/non-repeatability. OTP gives you the tooling—releases, versions thereof, and simultaneous multiple module tenancy being key—to actually do a good job. That's a rare thing.
- xxpor 13y agoThere is essentially no reason why this should ever be needed.
- kyllo 13y agoUnless you're an Erlang or maybe Smalltalk programmer
- tel 13y agoThen provide compile-time warnings---something still not done. Haskell's GHC now does -fdefer-type-errors
- JoshTriplett 13y agoYou can easily do that in a statically typed language as well; you just have to do it explicitly. For instance, Haskell has the error function, of type "String -> a"; you can use it absolutely anywhere, no matter the expected type, give it an error message, and if the value it produces is ever actually used, it throws an exception with the specified message.
- tel 13y agoAlso the trace module is pretty useful for the kind of dynamic-debugging practice people often do.
- andrewflnr 13y agoDon't discount the value of doing it implicitly. When you're just throwing stuff together (and there is a place for that), it's a distraction to work around parts of the system that won't work yet, both the typing and the mental overhead.