[HN Gopher] Algebraic effects, ownership, and borrowing
___________________________________________________________________
Algebraic effects, ownership, and borrowing
Author : thunderbong
Score : 70 points
Date : 2024-02-21 16:50 UTC (6 hours ago)
(HTM) web link (antelang.org)
(TXT) w3m dump (antelang.org)
| turtleyacht wrote:
| Ante is
|
| > A low-level functional language for exploring algebraic
| effects, safe shared mutability, and other novel features
| detourdog wrote:
| This has nothing to do with economics.
| lilactown wrote:
| That's true
| Diris wrote:
| I love ante's concept, I need to try actually using it sometime.
| rayiner wrote:
| The author's other blog post is also interesting, highlighting
| some of the complexity in Rust arising from tying together the
| concepts of shared references and immutability:
| https://antelang.org/blog/safe_shared_mutability/ (I.e. in Rust,
| mutability precludes shared references, even when it would be
| safe, such as when those references could not be shared across
| threads.)
|
| Getting rid of explicit lifetime variables is also an interesting
| choice within this design space.
| Georgelemental wrote:
| Rust chose to tie these together for a reason:
| https://manishearth.github.io/blog/2015/05/17/the-problem-wi...
| foldr wrote:
| >such as when those references could not be shared across
| threads
|
| Shared references can be problematic in a single threaded
| context too. (You may well be aware of this, but posting for
| the benefit of anyone who isn't.) This blog post has a good
| summary of the problematic cases:
| https://manishearth.github.io/blog/2015/05/17/the-problem-wi...
| SkiFire13 wrote:
| Rust does have something equivalent to what's described in the
| article you linked (and in fact the article even cites it):
| `&Cell<T>`. It does have some drawbacks compared to what's
| described in the article though (e.g. no built-in field
| projection, but it can technically be added in a future
| compiler version). It is also not completly free: it requires
| custom implementations of `Clone` to be `unsafe` (in Rust this
| is equivalent to the fact you cannot clone the `T` inside a
| `&Cell<T>`, this could also be fixed with an `unsafe trait`).
| Overall the idea is nice though and I'm curious to see how it
| will turn out in practice.
| CooCooCaCha wrote:
| I love this combination of ideas. I don't love the Haskell
| inspired syntax though. I think Rust made the right call to go
| with more traditional syntax
___________________________________________________________________
(page generated 2024-02-21 23:00 UTC)