Building Mirah from the source.

Prerequisite

To build Mirah, we need following packages:

  • git
  • java, javac
  • ant

XXX: installation instructions for each OSes here.

Download JRuby

Mirah is written in JRuby so we need the latest JRuby distribution to build the Mirah compiler.

$wget http://jruby.org.s3.amazonaws.com/downloads/1.5.2/jruby-bin-1.5.2.tar.gz
$tar xvzf jruby-bin-1.5.2.tar.gz
$mv jruby-1.5.2 jruby

Note that you don’t need this step if you already have JRuby installed.

Check out sources

Next step is to checkout Mirah and Bitescript.
Bitescript is a ruby library used by the Mirah compiler.

Both can be checked out from github.

$ git clone http://github.com/headius/bitescript.git
$ git clone http://github.com/mirah/mirah.git

Build Mirah

Now we can build Milar binary using jruby.

$cd ./mirah
$ ../jruby/bin/jruby -S rake jar

Run and Compile a Mirah Script

mirah command is a jruby script, which is available at ./bin:

$echo 'puts "hello"' > hello.mirah
$ PATH=$PATH:../jruby/bin/ ./bin/mirah hello.mirah 
hello

For building java classes, mirahc is also available.

$ PATH=$PATH:../jruby/bin/ ./bin/mirahc hello.mirah
$ java Hello # The compiled class is stored as ./Hello.class
hello

Having a trouble?
Consult .