Deprecated! Moved!
This version of Coalton was a prototype and is here for archival purposes only. It is not maintained. The project is now officially located at this link.
Coalton
Check out the library to see the latest that Coalton can express!
Coalton is a dialect of ML embedded in Common Lisp. It emphasizes practicality and interoperability with Lisp, and is intended to be a DSL that allows one to gradually make their programs safer.
Coalton currently allows one to do the following in Common Lisp:
- Express statically typed programs similar in spirit to Standard ML, OCaml, and Haskell.
- Perform compile-time type inference and type checking a la Hindley-Milner type inference.
- Optionally, global values can be manually declared if desired.
- Interoperate an ML-like with Common Lisp, in both directions. All data values are native and easy data structures.
- Define parameterized algebraic data types, including mutually recursive types.
- Define macros using the standard
defmacrofacility that is understood by Coalton. (In Coalton,ifis a macro that expands into amatchon theBooleantype!)
Coalton does not intend to re-define how Lisp is written entirely, but rather it serves to augment Lisp with an additional, available programming dialect.
Coalton is a work-in-progress and has some limitations:
- [bug] Unit tests aren't at all written. USE AT YOUR OWN RISK!
- [bug] Redefinitions don't play well in a lot of ways:
- Types aren't globally re-checked or warned about.
- The internal type DB is frequently clobbered with new data.
- [bug] Declared types are used for inference, but are simply believed without question. As such, a bug in a declaration will cause runtime bugs.
- [bug] Nested patterns, guards, and a more elaborate pattern grammar is not implemented.
- Generalized algebraic data types, type classes, and high-order types are neither implemented nor supported.
- ML structures, signatures, or functors are neither implemented nor supported.
Coalton-Lisp Bridge
Coalton within Lisp
Coalton value definitions come in two forms.
;; Coalton
(define f v)
;; Lisp
f ; an object (possibly a function) in the variable namespace
; can be lexically shadowed
;; Coalton
(define (f x ...) v)
;; Lisp
f ; a function object in the variable namespace
; can be lexically shadowed
#'f ; a function object in the function namespace