by astampoulis

astampoulis / makam

The Makam Metalanguage

144 Stars 8 Forks Last release: Not found GNU General Public License v3.0 223 Commits 14 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

The Makam metalanguage -- a tool for rapid language prototyping


Copyright (C) 2012- Antonis Stampoulis

This program is free software, licensed under the GPLv3 (see LICENSE).


Makam is a metalanguage that eases implementation of languages with rich type systems, supporting concise and modular language definitions, aimed at allowing rapid prototyping and experimentation with new programming language research ideas. The design of Makam is based on higher-order logic programming and is a refinement of the λProlog language. Makam is implemented from scratch in OCaml.

The name comes from the makam/maqam of traditional Turkish and Arabic music: a set of techniques of improvisation, defining the pitches, patterns and development of a piece of music.

The design and development of Makam started in 2012 at MIT, under the supervision of Prof. Adam Chlipala, and continues as a personal project at Originate NYC.

To read more about Makam, visit my homepage:


There are multiple ways to install Makam: The easiest way is by using the

Node.js package that includes a pre-compiled Makam binary.
  • Install through Node. This is the easiest way, as it requires only a Node.js installation; the package includes a pre-compiled Makam binary.
  • Install through OPAM. This requires both an OCaml and a Node.js installation, and compiles Makam from source.

Install through Node



In Ubuntu/Debian Linux:

    curl -sL | sudo -E bash -
    sudo apt-get install -y nodejs

In MacOS X:

    brew install node

Windows are not supported through this method at this time, as there is no pre-compiled binary for this platform in the Node.js package. Compiling from source should work though.

  • Install the

    npm package globally (you might need
    npm install -g makam
  • Clone the Makam repository to have examples locally:

    git clone
    cd makam
  • Use

    to run the REPL:
  • If you

    git pull
    a newer version of the repository, make sure to also update your Makam installation with:
    npm install -g makam

(Alternatively, instead of installing Makam globally, you can install Makam under

npm install makam
, in which case you'll have to use
to run
, or add
to your path.)

Install through OPAM


  • OPAM
  • opam switch create ./
  • eval $(opam config env)
  • Node.js 8.x
  • make
  • ./makam


Clone the repository to get the Makam source code.

git clone

You then need to install OPAM, the OCaml Package Manager. Instructions are available at:

We have been testing using the OCaml 4.07.1 configuration. Creating a local switch is the recommended way to keep the OCaml compiler configuration and dependencies separate from other OCaml projects you might have. To create a local switch, install all dependencies, and set up the environment variables you need, do:

  • opam switch create ./ ocaml-base-compiler.4.07.1
  • eval $(opam config env)

Makam also depends on Node.js, which is used for optimized parser generation. Instructions are available at:

Most recent versions of Node.js should work. If you are on an old version (before

), you can use
to install a newer Node.js version:
npm install -g nave && nave use 12

(Other Node version managers like

should also work.)

Finally, compile Makam:


Now, when you want to run Makam, just issue:


Examples written in Makam are available in the same repository that you cloned above. Having a local copy is useful as a reference point, since there's no tutorial yet; look in the


To update your version of Makam, you can do:

git pull
opam install . --deps-only

Using Makam

Unfortunately we do not have a Makam tutorial yet. I am in the process of writing introductory posts which will be available in my homepage:

Look into the files in the

directory for sample developments in Makam.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.