DEF is a low-level programming language designed for transparent compatibility with C for integration with existing C projects, as well as being good at the things C is good at. DEF, however, has a number of language features missing from C, related to concurrency. It includes Cilk-style parallel constructs, native support for transactions, and includes integrated memory reclamation for concurrent data structures.
Additionally, DEF contains modern language features that C is missing (tuples, parallel and concurrency constructs, array slices, and more), and a syntax that exposes features that are difficult to use in C, such as function pointers. A description of the language can be found at the DEF wiki.
This repository contains the source for the def
compiler, a suite of unit and regression tests, and additional tools for language support.
DEF is currently supported only on GNU/Linux. Instructions are for Ubuntu (or Debian-like) systems, but they should be easily generalizable to systems with other package managers.
OCaml and libraries:
sudo apt-get install ocaml ocaml-nox
sudo apt-get install opam
opam init
opam install menhir
opam install cmdliner
opam install ctypes
Forkscan:
LLVM:
Build the def
compiler binary and defghi
utility with:
% make
% sudo make install
If you choose not to install it, the built binaries are in the repo at build/bin/
.
A simple def-mode
for emacs is provided in the tools
directory that will color keywords. To add it to your installation, either leave it in its directory in the repo or copy it to a subdirectory under ~/.emacs.d
. Then modify the ~/.emacs
file (or whatever your emacs initialization file is) to add the following lines:
(add-to-list 'load-path "/path/to/def-mode-directory/")
(require 'def-mode)
Contributions are extremely welcome. Clone the repository and create pull requests.
Comments or bugs: Contact the original author and maintainer, William M. Leiserson, at willtor@mit.edu.