4 ms·
A GC doesn't make data sharing in multithreaded applications safe.
by stewbrew 9y ago
A GC doesn't make data sharing in multithreaded applications safe.
- dozzie 9y agoOnce you have "Erlang-like actors", you don't have data sharing.
- vanderZwan 9y agoYou do in Pony. One point of the type system is to allow safe passing of data between actors without copying everything.
- dozzie 9y agoThen you don't have "Erlang-like actors", which is an implementation of CSP (unintended, designed separately, but still). Unless you mean that some data is shared, but cannot be modified, but this would be semantically identical to not sharing anything.
- vanderZwan 9y agoShared immutable data is one option, but what I also mean is that when the type system can guarantee at compile time that the actor sending the data does not have read- or write- access to the data after sending, the system knows it can just "recycle" the old data, without run-time overhead. Look, just read up on the type system, specifically reference capabilities[0]. It's basically what allows for safe mutability and data passing when required. [0] https://tutorial.ponylang.org/capabilities/reference-capabilities.html https://tutorial.ponylang.org/capabilities/reference-capabil...
- Eerie 9y ago>Unless you mean that some data is shared, but cannot be modified, but this would be semantically identical to not sharing anything. That's the gist of Rust's borrow checker. Shared data can't be modified (unless you use a Mutex or something similar, but then you need to acquire a lock, so data you can mutate is not shared).
- bascule 9y agoErlang puts all binary data on a heap which is shared between actors
- dozzie 9y agoI said already: > [...] this would be semantically identical to not sharing anything. Erlang's data sharing (and no, not all binary data, just over a certain threshold; if you want to nitpick, be diligent and precise) is merely optimization trick, highly uninteresting when it comes to discussing type systems (because its semantics are identical to not sharing anything at all). BTW, if you talk about Erlang, use proper Erlang's terminology. Erlang doesn't have "actors", it has "processes".