Facebook's Hack lang is open source, though not publicly documented. This commit points out a lot of the implementation and test files: https://github.com/facebook/hhvm/commit/db9577b1409b74293fd9...
Fascinating! I had no clue.
fyi this is open sourced https://github.com/box/augmented_types
Edit: Clarity