The Makam Metalanguage
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci fix build using ocaml 4 06 (#39) May 18, 2018
bootstrap initial commit Jul 8, 2014
emacs add Makam AWS lambda (#31) Jan 19, 2018
examples switch ints to bigints (#48) Oct 29, 2018
grammars concrete_reify and syntax syntax that uses it (#49) Oct 29, 2018
js concrete_reify and syntax syntax that uses it (#49) Oct 29, 2018
npm concrete_reify and syntax syntax that uses it (#49) Oct 29, 2018
ocamlsyntax/xtype initial commit Jul 8, 2014
opam concrete_reify and syntax syntax that uses it (#49) Oct 29, 2018
parsing bumped ocaml version to 4.02.1 and fixed README Dec 9, 2014
scripts remove WIP.md file Oct 29, 2018
stdlib concrete_reify and syntax syntax that uses it (#49) Oct 29, 2018
termlang concrete_reify and syntax syntax that uses it (#49) Oct 29, 2018
tests switch ints to bigints (#48) Oct 29, 2018
toploop concrete_reify and syntax syntax that uses it (#49) Oct 29, 2018
utils fix ustring (#40) May 18, 2018
webservice allow more memory in lambda Apr 29, 2018
webui concrete_reify and syntax syntax that uses it (#49) Oct 29, 2018
.gitignore publish to npm (#30) [ci skip] Jan 7, 2018
.merlin switch ints to bigints (#48) Oct 29, 2018
.travis.yml fix build using ocaml 4 06 (#39) May 18, 2018
LICENSE initial commit Jul 8, 2014
Makefile add tiny-ml (#46) Oct 20, 2018
README.md webui fixes May 30, 2018
_oasis concrete_reify and syntax syntax that uses it (#49) Oct 29, 2018
_tags update to ocaml 4.04 Oct 16, 2017
configure add packaging through OASIS and OPAM May 25, 2015
init.makam Add PEG parsing (#14) Nov 22, 2017
makam publish to npm (#30) [ci skip] Jan 7, 2018
makam.in add packaging through OASIS and OPAM May 25, 2015
myocamlbuild.ml add packaging through OASIS and OPAM May 25, 2015
setup.ml add circleci tests Nov 16, 2017

README.md

The Makam metalanguage -- a tool for rapid language prototyping

CircleCI

Copyright (C) 2012- Antonis Stampoulis

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

Introduction

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:

http://astampoulis.github.io/

Installation

There are multiple ways to install Makam: The easiest way is by using the makam 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

TL;DR

Instructions

  • Install Node.js 8.x

    In Ubuntu/Debian Linux:

      curl -sL https://deb.nodesource.com/setup_8.x | 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 makam npm package globally (you might need sudo):

      npm install -g makam
    
  • Clone the Makam repository to have examples locally:

      git clone https://github.com/astampoulis/makam.git
      cd makam
    
  • Use makam to run the REPL:

      makam
    
  • 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 ./node_modules with npm install makam, in which case you'll have to use ./node_modules/.bin/makam to run makam, or add $(pwd)/node_modules/.bin to your path.)

Install through OPAM

TL;DR

  • OPAM
  • opam switch 4.06.0
  • eval $(opam config env)
  • Node.js 8.x
  • opam pin add makam . --no-action
  • opam install makam --deps-only
  • make
  • ./makam

Instructions

Clone the repository to get the Makam source code.

git clone https://github.com/astampoulis/makam.git

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

http://opam.ocaml.org/doc/Quick_Install.html

We have been testing using the OCaml 4.06.0 configuration, which you can switch to with opam switch 4.06.0 after you have installed OPAM. Make sure you have also loaded the needed environment variables with eval $(opam config env).

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

https://nodejs.org/en/download/

Most recent versions of Node.js should work. If you are on an old version (before 7.x), you can use nave to install a newer Node.js version:

npm install -g nave && nave use 8

(Other Node version managers like n and nvm should also work.)

After you have OPAM installed, you need to install the Makam dependencies:

opam pin add makam . --no-action
opam install makam --deps-only

And finally, compile Makam:

make

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

./makam

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 examples directory.

To update your version of Makam, you can do:

git pull
opam install makam --deps-only
make

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:

http://astampoulis.github.io/makam/

Look into the files in the examples/ directory for sample developments in Makam.