Could you implement Linear Types in Julia?

I was watching the video 2024 LLVM Dev Mtg - Implementing Linear / Non-destructible Types in Vale and Mojo by on of the Devs developing Mojo and Vale (which is really cool btw. check it out). And he was talking about Linear Types and one of the things I liked very much about Linear Types is that it allows to encode to the compiler a way to ensure certain methods are called before the end of the scope. (Hopefully i understood this correctly)
I was interested if someone came along a way to implement this in Julia. I know that for the most part we do not actualy deallocate or destroy objects manually. But I like the potential to check whether certain methods on types were called before the end of the scope.

1 Like