Building mulang from source
Setup
To generate mulang
executable, you have to build the project using stack:
- Install stack:
wget -qO- https://get.haskellstack.org/ | sh
- Go to the mulang project directory and setup it:
stack setup
- Build the project:
- If you need a production ready build, run
./build.sh
- If you just need a quick-to-compile development version, run
./build.sh --fast
- If you need a production ready build, run
Installing and creating an executable
# This will generate a `mulang` executable in the folder `~/.local/bin`.
$ stack install
# Run mulang
$ mulang
Running tests
# This will build the project and run rspec and hspec tests
$ ./test.sh
Watching changes
# This will build the project and run rspec and hspec tests, and wait for changes in hspec tests
$ ./test.sh --file-watch
Ruby wrapper
See
gem/README
for more details.
Building
:warning: You will need Ruby 2.3+.
cd gem
# install ruby
bundle install
# wrap gem and run rspec tests
rake
Loading
Run bin/console
in the gem
directory.
JavaScript library
See
ghcjslib/README
and https://www.npmjs.com/package/mulang for more details.
mulang
can also be compiled to JavaScript library using ghcjs and ghcjslib, which allows you to use it from node
or the browser.
Building
:warning: you will need
node >= 7
installed on your system. If you havenvm
, before starting run the following:
sh $ nvm use $(cat ghcjslib/.nvmrc)
# 1. Swap to GHCJS compiler
ghcjslib/swap.sh
# 2. Build ghcjslib release. It will be placed on ghcjslib/build/mulang.js
ghcjslib/build.sh
# 3. Run both mocha and hspec tests.
ghcjslib/test.sh
# 4. Run again for swapping back to ghc
ghcjslib/swap.sh
Loading
- in the browser:
google-chrome ghcjslib/index.html
- in
node
: runnode
, and then, within the interpreter, run:let mulang = require('./ghcjslib/build/mulang.js');
Updating docs
These site is build using mkdocs >= 0.17
. You can install it using pip
:
$ pip install mkdocs
From the project root folder, running ./docs/devinit
will setup the docs, ./docs/devstart
start the site locally, and mkdocs gh-deploy
will deploy the documentation.