16

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?

Mechanical snail
  • 29,755
  • 14
  • 88
  • 113
Ishihara
  • 1,099
  • 2
  • 11
  • 19

4 Answers4

11

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.

Judge Maygarden
  • 26,961
  • 9
  • 82
  • 99
sepp2k
  • 363,768
  • 54
  • 674
  • 675
3

I've recently stumbled upon something related:

The Habit Programming Language (lambda-the-ultimate.org)

It's a dialect of Haskell, but geared towards low-level systems programming.

Christian Klauser
  • 4,416
  • 3
  • 31
  • 42
1

This is basically the goal of Mozilla's http://www.rust-lang.org/

singpolyma
  • 10,999
  • 5
  • 47
  • 71
1

See also BitC, a language being developed to build a formally verified capability secure operating system.