Daily Thought - 2025-03-12
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!
One thing that I'm still not clear on, is field visibility: How to control whether a field of a record (or a case of a variant?) is visible outside of the module where the record or variant was defined.
Remember: By default, those types are structurally typed. I think this also means that by default, all fields (and cases) must be public by default. Because what would a private field of a structurally typed record even mean? What would it be private to? You could always define your own version, indistinguishable from any other. In that context, privacy makes no sense.
But if you define a nominal type, that equation changes. Because now, you have a single instance of the type, and it often makes sense to privilege the module where that instance was defined. That's how you can build abstractions.
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.