Get the latest tech news

You Need Subtyping


Ever since Stephen Dolan’s 2016 thesis Algebraic Subtyping showed how to combine type inference and subtyping, I’ve been developing increasingly sophisticated programming languages based on those ideas, first IntercalScript in 2019, then CubiML in 2020, PolySubML in 2025, and with my next language already in the planning stages.

The usual reaction to an example like this is something like “Well, that might be ok for high level languages where all values are boxed anyway, but if you care about performance, you need to compile things with fixed type-dependent memory representations, so you can’t have subtyping relationships between records of different widths like that. Null pointer errors are such a common problem in programming that most modern languages have some way of checking nullability in the type system to statically prevent mistakes. In order to statically check properties like nullability that don’t affect memory layout, the compiler needs to support subtyping.

Get the Android app

Or read this on Hacker News