Welcome to the egison wiki!
$ git clone https://github.com/egisatoshi/egison.git
It will create egison directory.
For now, we use this VM "haskell-eval" via vagrant 1.1. The VM needs about 6GB disk space. 8MB space will be enough.
-
Install vagrant. For Mac OSX, using ruby-gem is easy.
-
setup haskell-eval VM in egison directory
# Vagrant box add would download 1GB file. After this, box config is added to ~/.vagrant.d/boxes
$ vagrant box add haskell-eval http://download.fpcomplete.com/haskell-eval-alpha-2013-01-29.box
$ cd (The path to top of your egison files)
$ vagrant init
Now, your egison directory should be like this.
hoge@fuga ~/dev/egison3 (takei-shg)
$ ls
LICENSE README.md Vagrantfile benchmark cabal-dev dist egison.cabal elisp hs-src lib sample test
Check the Vagrantfile is in your directory.
Now start to install the VM.
# Start to create VM image. It will takes several minutes.
$ vagrant up
After the vagrant VM is ready, let's connect to the VM.
hoge@fuga ~/dev/egison3 (takei-shg)
$ vagrant ssh
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)
* Documentation: https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Wed May 1 00:49:33 2013 from 10.0.2.2
vagrant@precise32:~$
Now, You are connecting the VM via ssh.
This VM has GHC 7.4.2 and some libraries from Stackage repository.
Unfortunately, cabal is not on the path, so let's set.
vagrant@precise32:~$ vi .bash_aliases
export PATH=$PATH:~/.cabal/bin/
vagrant@precise32:~$ . .bashrc
vagrant@precise32:~$ cabal update
Check that you can call cabal. I recommend not to update cabal-install itself.
The directory where the Vagrantfile exists is automatically mounted onto the Vagrant VM.
The path to the mounted directory is /vagrant
vagrant@precise32:~$ cd /vagrant
vagrant@precise32:/vagrant$ ls
benchmark cabal-dev dist egison.cabal elisp hs-src lib LICENSE README.md sample test Vagrantfile
Now, let's build Egison!!
vagrant@precise32:~$ cabal install
vagrant@precise32:/vagrant$ find ~/.cabal/ -name "egison"
/home/vagrant/.cabal/bin/egison
vagrant@precise32:~$ cd /vagrant
vagrant@precise32:/vagrant$ egison sample/poker-hands.egi
<Straight-Flush>
<Flush>
<Full-House>
<Straight>
<Nothing>
Unbound variable: main
You can also execute Egison Interpreter.
vagrant@precise32:/vagrant$ egison
Egison Version 3.0.0 (C) 2011-2013 Satoshi Egi
http://egison.pira.jp
Welcome to Egison Interpreter!
>
First, you should install egison with --enable-tests option.
vagrant@precise32:/vagrant$ cabal install --enable-tests
Now you can execute cabal test
.
vagrant@precise32:/vagrant$ cabal test
When you leave the development of Egison, type this.
$ cd (The path to egison)
$ vagrant halt
This will shutdown your VM gracefully (doc).
When you want to delete the VM image, type this.
$ vagrant destroy
That's all. Enjoy!!