3 ms·
The line "erlang has no mutable data structure" made me think about something : Couldn't you imagine a language with data structure that are mutable from withi
by bsaul 12y ago
The line "erlang has no mutable data structure" made me think about something :
Couldn't you imagine a language with data structure that are mutable from within a same single thread only and requires message passing when communicating between threads ?
Now that i think of it, I wonder if golang isn't doing just that.
- keyneus 12y agoGo allows pointers to be sent over channels, so it's up to you to make sure you send copies of data to prevent problems. So no, I'd say Go isn't doing that; or rather, it does require message passing but there's a huge loophole which means you basically can share mutable state unsafely. Rust, on the other hand, is much closer to what you're describing.
- rssaddict 12y agoI'm not too clear on the details since I don't know the language, but I think that Rust's (http://www.rust-lang.org/ http://www.rust-lang.org/) concept of "ownership" does something very similar to what you're suggesting.
- marianoguerra 12y agoin clojure there's something similar called transients http://clojure.org/transients http://clojure.org/transients