3 ms·
I would argue the immutability is actually not a great thing in Erlang to be honest. It makes it hard to reason about what gets copied, what gets shared in the
by banachtarski 9y ago
I would argue the immutability is actually not a great thing in Erlang to be honest. It makes it hard to reason about what gets copied, what gets shared in the global heap which may be a source of contention, makes code unnecessarily verbose, etc. I think it's one of those features (like lazy evaluation in Haskell) that language practitioners tend to advocate without necessarily understanding what tradeoffs they are making in the process.
- ams6110 9y agoIt actually makes reasoning easy. What gets copied: everything. What gets shared: nothing.
- im_down_w_otp 9y agoExcept that isn't true in Erlang (or other BEAM languages). Binaries larger than some threshold are managed on a shared-heap. I think a couple other things have been promoted to being managed that way too fairly recently.
- ramchip 9y agoYou might be thinking of the optimization for constant pool references: https://medium.com/@jlouis666/an-erlang-otp-20-0-optimization-efde8b20cba7 https://medium.com/@jlouis666/an-erlang-otp-20-0-optimizatio...
- im_down_w_otp 9y agoYes, that. Thank you.
- banachtarski 9y agoThat's not true in a number of cases, and thankfully what you said isn't right or the BEAM would truly be a disaster.