Avail
There is a rather unknown, but brilliant programming language called Avail that has been truly inspirational.
Avail has a very interesting take on types and gives a developer the means to ‘program’ a type system. When the Avail compiler compiles a user program, it dispatches on user defined multi methods that operate on types (or types of types), while the compiler’s meta type system keeps everything in check. How ingenious is that?
Avail stems from smalltalk, where you can have a (possibly infinite) hierarchy of meta-classes. In Avail you have something similar: a meta hierarchy of types (of types). Mind blowing.
Next to that, Avail allows programs to have an extremely flexible user-defined syntax. The compiler employs a type-directed parser, that backtracks on failure when types don’t unify to disambiguate syntax. Avail is a kind of meta parser/compiler on steroids, which is really cool.
If you are interested in programming languages as a subject of study, then head over to the Avail website. You won’t be disappointed.