In the same way to other Haskell softwares, Nirum compiler can be built using Haskell Stack. If you didn’t install it yet see also its installation guide.
If it’s your first build of Nirum compiler you need to setup a proper version of GHC:
The following command builds an executable binary of Nirum compiler:
A built executable binary aren’t installed to
command is run. Without installation a built executable binary can be invoked
stack exec command:
stack exec -- nirum -t python -o out/ examples/
-- indicates options after it belong to the
stack exec command.
Since it is a compiler which generate source codes, there are two scopes we should test:
- the compiler itself, and
- codes that the compiler generates.
The former is unit testing and the latter one is integration testing. We have two commands/scripts to run corresponding testing:
stack test :spec
stack test :targets
If you’ve changed things related to a target backend you should test everything:
If you’ve changed pure internals of the compiler probably it’s okay to run only the former command. Anyway both testings are run by CI so that changes breaking either testing cannot be merged.
Each target test suite has its external dependencies (i.e., non-library program dependencies):
- All Python versions that Nirum should support: Python 2.7, and 3.4 and above all
tox3.0.0 or higher
Since we want to keep our coding style consistently, we run lint to check it. You can get more information about hlint on its homepage.
We recommend you to register lint to Git hooks.
ln -s "$PWD/lint.sh" "$PWD/.git/hooks/pre-commit"
If you have registered a hook once, it will be automatically executed when you make a commit.
We believe logging changes is a part of making software. So we have the policy enforcing every pull request to have an entry to changelog (i.e., a diff on CHANGES.md file) on the CI.
[chagelog skip] on commit message if your change is not related to
the Nirum compiler (e.g., fixing a typo).