Skip to content

Latest commit

 

History

History
58 lines (52 loc) · 1.23 KB

README.md

File metadata and controls

58 lines (52 loc) · 1.23 KB

Mila

Build Status

A simple procedural and imperative language.

Features

Integers (decimal, hexadecimal, octal form), arrays, variables (local, global), constants, input/output, control flow, loops, blocks, procedures, functions, exit, recursion.

Syntax

Mila aims to be compatible with Pascal syntax. Due to a few extensions however, a program written in Mila is not guaranteed to be compatible with Pascal syntax. When unsure about syntax of some construct in Mila, searching the same for Pascal will be helpful enough most of the time.

Example

$ cat factorial.mila
var
  n, f: integer;
begin
  n := 5;
  f := 1;
  while n >= 2 do
  begin
    f := f * n;
    dec(n);
  end;
  writeln(f);
end.
$ mila factorial.mila # create executable program
$ ./a.out
120

More sample programs

Precompiled binaries

Releases

Building from source

sh build.sh

Mila binary can be found in

llvm-obj/Release+Asserts/examples

Runnings tests

cd tests
./run.py

License

MIT