Caterpillar

Daily Thought - 2024-07-19

< back to list

I talked a bit about linear types on here, but there's one important aspect I completely forgot to mention: Linear types can track ownership, and thus can be used to implement automatic memory management at compile-time, like in Rust.

That is very important to me. I think there are so many reasons to not want a garbage collector. It's a big black box that's running in your process, doing its own thing. Granted, for a purely functional language, there are better approaches. Roc can get away with just reference counting, since immutability means that reference cycles can not be constructed.

But I'm thinking, if Caterpillar is going to get linear types anyway, for all the reasons I mentioned, why not go that extra step and get automatic memory management with no runtime overhead? I think Rust has shown us what's possible. Now it's on the next generation of languages to show that, hopefully, we can do the same, but without much of the complexity.

<< previous thoughtnext thought >>