4 ms·
Erlang is purely immutable and doesn't have any "facilities for mutation" that I know about, although it does have side effects (I/O, but no Haskell-style effec
by lobster_johnson 10y ago
Erlang is purely immutable and doesn't have any "facilities for mutation" that I know about, although it does have side effects (I/O, but no Haskell-style effect system).
- klibertp 10y agoMaybe GP meant something like FFI? Which is a mechanism that allows for any mutation you'd like and is present in most FP languages.
- im_down_w_otp 10y agoThat's not entirely true. I built a FlatBuffers implementation for Erlang as NIFs so that I could still take advantage of FlatBuffers memory efficiency features, which fundamentally required "unsafe" and mutable access to a byte buffer. I just had to be very aware of exactly how the runtime was going to interact with my implementation and account for it. Sadly the place where I worked was not keen on open source posture, so it's locked away for all of time probably. However, the place I now work is a lot more open source friendly and I expect to take another whack at it, but using Rust on the NIF side this time around instead of C.
- lobster_johnson 10y agoWell, with NIFs you can do anything — it's a parallel C universe. I was really referring to Erlang the language.