No description
Find a file
Dmitry Boulytchev 3d1cd0dc45 Typos in spec
2020-09-12 20:56:04 +03:00
gdb GDB support draft 2020-09-10 22:15:57 +03:00
regression Tail-call optimization 2020-03-23 00:49:20 +03:00
runtime Fixed bug with unbox tag in Bsexp 2020-09-01 20:31:34 +03:00
spec Typos in spec 2020-09-12 20:56:04 +03:00
src Typos in spec 2020-09-12 20:56:04 +03:00
stdlib Cosmetics 2020-09-01 06:20:39 +03:00
tutorial Cosmetics in stdlib/spec 2020-03-08 00:57:25 +03:00
.gitignore Added missing files 2020-02-19 17:43:44 +03:00
.travis.yml Replace git-checkout with volume mounting from Travis sandbox 2018-03-06 17:41:06 +03:00
lama-spec.pdf Typos in spec 2020-09-12 20:56:04 +03:00
lama.png Better md 2020-02-18 14:04:25 +03:00
Makefile Moved x86only tests into stdlib/regression 2020-03-22 21:58:11 +03:00
opam Makefile, opam 2020-02-20 20:27:21 +03:00
README.md Added version info in README 2020-02-26 15:43:42 +03:00

Lama

lama is a programming language developed by JetBrains Research for educational purposes as an exemplary language to introduce the domain of programming languages, compilers and tools. Its general characteristics are:

  • procedural with first-class functions - functions can be passed as arguments, placed in data structures, returned and "constructed" at runtime via closure mechanism;
  • with lexical static scoping;
  • strict - all arguments of function application are evaluated before function body;
  • imperative - variables can be re-assigned, function calls can have side effects;
  • untyped - no static type checking is performed;
  • with S-expressions and pattern-matching;
  • with user-defined infix operators, including those defined in local scopes;
  • with automatic memory management (garbage collection).

The name lama is an acronym for Lambda-Algol since the language has borrowed the syntactic shape of operators from Algol-68; Haskell and OCaml can be mentioned as other languages of inspiration.

The main purpose of lama is to present a repertoire of constructs with certain runtime behavior and relevant implementation techniques. The lack of a type system (a vital feature for a real-word language for software engineering) is an intensional decision which allows to show the unchained diversity of runtime behaviors, including those which a typical type system is called to prevent. On the other hand the language can be used in future as a raw substrate to apply various ways of software verification (including type systems) on.

The current implementation contains a native code compiler for x86-32, written in OCaml, a runtime library with garbage-collection support, written in C, and a small standard library, written in lama itself. The native code compiler uses gcc as a toolchain.

In addition, a source-level reference interpreter is implemented as well as a compiler to a small stack machine. The stack machine code can in turn be either interpreted on a stack machine interpreter, or used as an intermediate representation by the native code compiler.

Language Specification

The language specification can be found here.

Installation

Prerequisites:

Installing:

  • opam pin add -n ostap https://github.com/dboulytchev/ostap.git#memoCPS (remember of "#" being a comment character in bash)
  • opam pin add -y lama https://github.com/JetBrains-Research/Lama.git

Smoke-testing:

  • pushd tutorial
  • make
  • popd