Daily Thought - 2025-03-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!
Mixing up the concepts of nominal and opaque types may not
be a good idea in the first place. And certainly, doing that and having
per-field control over visibility are not the only alternatives. What about
having both nominal
and opaque
in the language, as separate concepts?
One takes any type and makes it nominal, as previously proposed. The other takes any type and makes all of its fields (or cases, for a variant?) private. That would allow structural but opaque types, which is a nonsensical combination. But like with anonymous nominal types, that's probably not too bad, as long as it's clear what every feature does.
It's important to remind myself, I'm not looking for a final solution here. That
can only come out of a long process of testing and real-world use. What I'm
looking for is a sensible first draft. And separate nominal
and opaque
keywords might be just that.
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.