Re:Higher RAII and the seven arcane uses of linear types
by robert-wallis on Wednesday May 15, 2024 @02:18AM
(#40363660)
How about COO - Close Object Obligation? And you could sound like a pigeon saying "coo" during talks explaining it.
Re:Higher RAII and the seven arcane uses of linear types
by verdagon on Wednesday May 15, 2024 @11:05AM
(#40367905)
Hah I like this one!
PS. Congrats! https://verdagon.dev/blog/easter-egg-notes
Re:Higher RAII and the seven arcane uses of linear types
by NeutralForest on Wednesday May 15, 2024 @05:55AM
(#40364922)
Thanks for the answer! Not gonna lie, I don't have the background to understand all your articles, just enough to see that you're pushing the boundary on what's possible and it's really cool!
Re:Higher RAII and the seven arcane uses of linear types
by verdagon on Wednesday May 15, 2024 @11:08AM
(#40367957)
Thanks! And yeah I get that a lot >_> You're always welcome to swing by the discord where I can give a less arcane explanation! (https://discord.gg/SNB8yGH)
Re:Higher RAII and the seven arcane uses of linear types
by gpderetta on Wednesday May 15, 2024 @08:25AM
(#40365993)
> In single-ownership languages like C++, Rust, etc. we've been conflating the destructor to handle two things: fulfilling the object's final purpose, and handling exceptions/panics.
Well, from a transactional point of view, a good design for C++ classes is to have implicit destructors (i.e. a conventional C++ destructor) rollback any change, while explicit ones would commit. This works very well with exceptions.
What C++ lacks is the ability to statically prevent you from calling an explicit destructor twice, but should be doable, for example, in rust.
1. In RC and tracing GC languages, a linear object would need exactly one special "linear" reference to it, which would be responsible for eventually "consuming" (though not deleting) the object by handing it to its final destination function. (You can tell, I'm trying real hard to not say destructor here)
2. In single-ownership languages like C++, Rust, etc. we've been conflating the destructor to handle two things: fulfilling the object's final purpose, and handling exceptions/panics. It seemed convenient at the time, but it also prevented linear types.
But honestly, I think we were just stuck in a local maximum. There was no reason to change those points because we didn't know about higher RAII, and we didn't know about higher RAII because those two points prevented linear types.
But with more of us exploring this new area (Vale, Austral, maybe even Mojo!), I daresay we'll one day see linear types and higher RAII entering the mainstream. Especially if someone can come up with a better name!