Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



I'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/) concept of "ownership" does something very similar to what you're suggesting.


Go 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.


in clojure there's something similar called transients http://clojure.org/transients




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: