Crosscut

Daily Note - 2025-06-18

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

Let's recap: Traits can be nominal or they can be structural, and they can be named or they can be anonymous. And there are good reason to choose either of those options, except for the nonsensical combination of nominal/anonymous.

Structural traits are low-friction and flexible, but you risk using functions whose signature happens to match, while the implementation is totally unexpected. Nominal traits prevent that by requiring the trait implementation to be intentional, at the cost of some traits not always being implemented where they could be.

Anonymous traits are light-weight, which an be convenient in the right situations. If traits can be both structural and anonymous, they can be fully inferred by the compiler. You wouldn't have to specify any types, yet still get full type checking. Such a statically typed language could feel as frictionless as a dynamically typed one.