What is Mezzo?
(Description shamelessly stolen from a paper abstract).
We present the design of Mezzo, a programming language in the ML tradition, which places strong emphasis on the control of aliasing and access to mutable memory. A balance between simplicity and expressiveness is achieved by marrying a static discipline of permissions and a dynamic mechanism of adoption and abandon.
More information about Mezzo
Mezzo is designed by François Pottier and Jonathan Protzenko. The language has been formalized using the Coq proof assistant. We currently have a prototype implementation of a type-checker. We have several papers, abstracts and presentations that describe the language. Since the language is always in flux, it is best to refer to the most recent publication.
Some reading
Papers
We currently have two papers that are relevant to the current state of the Mezzo project. The first one is about the Coq formalization, and the second one is about the language from a more general perspective.
- François Pottier. Type soundness for Core Mezzo. Unpublished, January 2013. [ bib | PDF | abstract ]
- François Pottier and Jonathan Protzenko. Programming with permissions in Mezzo. Submitted, March 2013. [ bib | abstract | PDF ]
Blog posts
We have a blog at Gallium, and there are a few blog posts there about the Mezzo programming language.
- Jonathan Protzenko. An introduction to Mezzo. [ HTML ]
- Jonathan Protzenko. An introduction to Mezzo, continued. [ HTML ]
Talks
The talks feature some detailed examples which are type-checked step-by-step, listing the set of available permissions at each step.
- Jonathan Protzenko. An introduction to Mezzo (short). ML Workshop, Sep 2012. [ PDF | YouTube ]
- Jonathan Protzenko. An introduction to Mezzo [ PDF ]
Downloads
- The latest version of the Coq proof.
- The latest snapshot of the prototype source code. Requires OCaml 4.00+, as well as the following tools/libraries: Menhir, MenhirLib, Yojson, Ulex, PPrint. Has been tested on Unix environments only. We recommend OPAM to easily install all the dependencies as well as a recent OCaml compiler.
- Generated documentation for the prototype's source code, including the scary dependency graph between modules. The documentation is fairly incomplete, since most .mli files are missing, but the source code does have comments.
- Latest git source. Please contact us if you're interested.
Demos
Sample programs
We showcase here some programs written using Mezzo. More code samples are available in the prototype's source code, in the corelib, stdlib and tests directories.
- The
listmodule (implementation, interface) provides operations on lists. - The
bucketmodule (implementation, interface) provides mutable lists of key-value pairs. It is used mainly by thehashtablemodule. - The
hashtablemodule (implementation, interface) defines hash tables. - The
mutableTreeMapmodule (implementation, interface) defines mutable tree maps using inspiration from the OCamlMapmodule. - The
queuemodule (implementation, interface) defines a FIFO queue using adoption/abandon. It's an extended version of the module shown in papers and during talks. - The
vectormodule (implementation, interface) provides resizable arrays. - The
lazymodule (implementation, interface) provides a way to deal with thunks, i.e. suspensions. - The
memoizemodule (implementation, interface). provides a library for memoizing the calls to a function using a hashtable internally. - The
persistentarraymodule (implementation, interface). - The
bfsmodule (implementation, interface) provides a generic interface for breadth-first traversal of graphs. - The
dfsmodule (implementation, interface). - The
nestmodule (interface) axiomatizes Boyland's nesting. - The
lockmodule (interface) shows our axiomatization of classical locks. - The
wrefmodule (implementation, interface) shows how to obtain “weak” references (ML-style) by using a lock to protect the invariant.
Graphical error messages with graphs
The type-checker has a feature where it can dump a graphical representation of its state to help understand a type error, or understand how a merge conflict was resolved. We provide a gallery of such dumps. Warning: works only on recent Firefox versions (I'm using ECMAScript 6 features).