Linear types proposal for Hare

47 points by runxiyu


yorickpeterse

I'm not sure this is really a proposal? It reads more like a collection of rough notes on what linear types in Hare might look like, but with very few details on how this would actually achieved, whether it would be memory safe and so on.

melodyogonna

I find the destructor part interesting, a good example of how previous design choices can make new ideas very difficult. Mojo is the language I know with good Linear type support, the design looks so simple because of how it composed with existing design decisions. There is no explicit "linear" keyword, instead you can achieve the behaviour for certain types by telling the compiler to disable implicit dtor for said types:

https://godbolt.org/z/r5G4K533d