Types

There are different ways to look at types in programming languages.

  1. They're descriptive. Types are used to annotate the properties of a variable and are meant as an indicator for other programmers. This is most common in dynamically-typed languages such as Python.
  2. They're prescriptive. Types are strictly enforced and checked. They are meant to assert statements at compile-time which would otherwise lead to runtime errors. These are meant more for the compiler, rather than other programmers.

Among prescriptive languages, some type systems are more expressive such as C++, Rust, Scala and Haskell.

In some languages, you can write meta-programs with types. This means you can write logic and programs all expressed through types and their components. Essentially, this means the compiler becomes an interpreter operating on types — which I think is pretty neat!

Thumbnail for N[Subtype Metaprogramming] is N[Mostly Harmless]
Thumbnail for N[Subtype Metaprogramming] is N[Mostly Harmless]

N[Subtype Metaprogramming] is N[Mostly Harmless]

Inheritance go brrrrrrrr... abusing turing-complete typesystems to write fun programs in Python.

Thumbnail for The Mathematics of Types
Thumbnail for The Mathematics of Types

The Mathematics of Types

Programming isn't about mindlessly typing away on a keyboard. There is an aesthetic quality that comes with approaching a problem.