/irida_x86

The Irida Compiler

Primary LanguageOCamlMIT LicenseMIT

The Irida Programming Language

NOTE Irida is a work in progress. Anything can change without prior warning. Do everything at your own risk.

Irida is general purpose compiled programming language that targets x86_64 GNU/Linux. It is a stack-based language as you put elements on the stack, and work with them by arranging them depending on the program.

Installation

Clone this repository, go to the project's folder and

sudo ./install.sh

Once it's done, you will have the irida command available on your system.

Note that you need dune in order to build the project

Running

If the Irida program is contained in file.iri you would do

irida ./file.iri

That will create the executable file with the same name (but without any extension) in the same folder that the file is. It will also run it.

For help:

irida -help

Examples

The examples folder contains programs that let you see what Irida is capable of.

Hello World

include std

printns: "Hello, world!"

Loop from one to ten

include std

0
loop
  1 add ddupl
  printni

  10 eq then
    0 exit
  end
end

Factorial

include std

proc rec fact
  dupl
  is_zero
    then drop 1
    else dupl pred fact mul end
end

fact: 5
  printni

Interesting fact: The name actually comes from the ancient Greek word ίριδα, which translates to iris, a beautiful garden flower.