Crosscut

Daily Thought - 2024-07-11

Hey, I'm Hanno! These are my daily thoughts on Crosscut, the programming language I'm creating. If you have any questions, comments, or feedback, please get in touch!

This thought was published before Crosscut was called Crosscut! If it refers to "Caterpillar", that is the old name, just so you know.

< back to list

Speaking of Rust, why do we need this business with linear types anyway? Why not just have something like Drop, which is Rust's implementation of destructors?

Destructors can work in many cases, but what if the destructor needs to do something that returns an error? Where would that go? What if the destructor needs to call an operation that's async? Those are real problems in Rust.

But it's not a problem with linear types. The compiler forces you to do something with a value. But what you do, where you do it, what resources you use to do it; that's up to you.

<< previous thoughtnext thought >>

Hey, you! Want to subscribe to my daily thoughts? Just let me know (maybe include a nice message, if you're up for it), and I'll send you an email whenever I post a new one.