Crosscut

Daily Thought - 2025-03-16

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!

I recently expressed worry about the interaction of move semantics and nominally typed records, if nominal typing implies that the fields of the record are private. But after working out how move semantics and records could actually interact, I'm no longer worried.

In contrast to Rust, every result of moving a value into or out of a record, would result in a fully usable record with a well-defined type. That's something you can easily build an API around, just like you can build one around reading and updating fields.

Now, if this manual approach of "let the user build an API" is the best way to handle the privacy of record fields, I don't know. But as I noted before, it would be a solution that doesn't require another feature in the language. So it may be the best place to start.

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 every time I post a new one.