Get the latest tech news

Nominal for Storing, Structural for Manipulating


Something that comes up sometimes in programming languages is the difference between nominal and structural type systems. While I'm definitely not the fir...

There is a reason why this is the default in most languages: it's great for data abstraction and error messages and generally makes for fewer surprises than the alternative. Therefore, the vast majority of programming languages primarily stick to nominal types and sometimes provide very limited, separate support for structural records or variants. This is more powerful than Gleam's approach, because this information is not just something the compiler keeps track of to make the coverage checker smarter; it's actually part of rest's type, which it can persist even accross function boundaries!

Get the Android app

Or read this on Hacker News