Crosscut

Daily Thought - 2024-10-17

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

Caterpillar will most likely have region-based memory management. This clears up the problem with recursive data structures, as those can just use handles into regions for recursive references. It introduces new problems though, this time related to the type system.

There will certainly be data structures (recursive or otherwise) that use handles, care very much about what type of thing those handles point to, but don't care at all (i.e. are generic over) what specific type of handle they're dealing with. This would be a higher-kinded type.

Higher-kinded types are a rather advanced feature of static type systems, and I kinda hoped that I could avoid having them in Caterpillar. First, because complexity is a cost, and all else being equal, costs should be avoided. Second, because according to my understanding, higher-kinded types cause problems for type inference.

<< 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.