3 ms·
> its really strange that there are two languages running around together. Mmh, I'm not sure I would agree with that. I've been using Arc & Rc for both async a
by Fiahil 5y ago
> its really strange that there are two languages running around together.
Mmh, I'm not sure I would agree with that. I've been using Arc & Rc for both async and non-async code, and even in single-threaded code. It's less about what flavor of concurrency you're using, than what program you're writing.
Arcs and references can coexist and are useful for different reasons. It would be a tragic loss for me if the language was (re-)adopting garbage collection or reference counting globally -even optionally. They are made to go along one another.
Edit: for example, tree-like or graph-like structures can use Arc and Weak [see arc documentation] in single-threaded code to enjoy reference-counted, cyclic, heap allocations in order to store a reference to a parent or sibling node.
You can do that with boxes, but Arcs have benefits if you want your code to work in a multithreaded environment.
- convolvatron 5y agomy perspective is that everything I do is asynch and multithreaded. so the whole hierarchical allocation part of the language is largely useless to me. once i figured that out, its really not so bad. but anytime a collaborator or a library tells me to use lifetimes I just get all churlish.