Search code examples
chaskelllow-leveltype-safetytype-systems

Haskell-like type system in C


I was wondering, is it possible to integrate haskell's powerful type system into a language like C, and still be able to do efficent low level programming?


Solution

  • There have been attempts to create low-level languages which use advanced type systems to make low-level programming safe. Those type systems are often actually even more advanced than Haskell's and allow things like ensuring at compile-time that pointers are accessed safely and arrays are not accessed out of bounds.

    One such language is ATS (Applied Type System) which besides many of Haskell's type system features also supports linear and dependent types.