4 ms·
> course, given the 3,619,661 compiler extensions in GHC, whats another that would enable this sort of lifetime/reference tracking (and endless chasing of type
by twic 8y ago
> course, given the 3,619,661 compiler extensions in GHC, whats another that would enable this sort of lifetime/reference tracking (and endless chasing of type errors that all Haskellers are used to anyway) functionality to be pushed into the type system?
Rust-style ownership semantics exert strong design pressure on libraries, including the standard library. Rust's ecosystem has evolved under that pressure; Haskell's has not. I have no doubt at all that Haskell could be extended with affine types (never go in against a Haskeller when a conference paper is on the line!), but once you'd done that, you wouldn't be able to use any existing libraries.
Which, given the state of the Haskell ecosystem, might be a bit of a relief.
- pcwalton 8y agoThis is also the reason why bolting lifetimes on to C++ is not really feasible while still being able to call the resulting language C++.
- pjmlp 8y agoThey are being bolted on static analysis tools. So yeah, optional tooling quite often doesn't get used and is imperfect. On the other hand, many will not move if they can get 80% there, while keeping their tooling and libraries.
- pcwalton 8y agoObviously we disagree about whether any attempts to add lifetime analysis to C++ gets anywhere near 80% of what Rust can provide.
- garmaine 8y agoActually no, Linear Haskell works in a fully backwards compatible way with existing libraries. I suggest checking it out.
- twic 8y agoWhat would you suggest i read? I have got the 'Retrofitting Linear Types', and a quick scan suggests it doesn't give concrete examples of that backwards compatibility (although it probably follows from the proofs, which i have not digested yet!). Is there something more practical?
- garmaine 8y agoThere's a bit more said about it here: https://arxiv.org/pdf/1710.09756.pdf https://arxiv.org/pdf/1710.09756.pdf