]> Witch of Git - ivy/blob - README.md
[tools] Add tools/test.py as the project test runner
[ivy] / README.md
1 # Ivy
2
3 [Little lambdas eat ivy.][etymology]
4
5 [etymology]: https://en.wikipedia.org/wiki/Mairzy_Doats
6
7 Ivy is an impure functional language that compiles to native code. It was
8 developed as an educational project to learn more about compiling functional
9 languages, and compiling without going through frameworks like LLVM that handle
10 the backend. It currently supports x64, and requires clang as an assembler.
11
12 ## Setup
13
14 Running the compiler requires the Ivy runtime be on the linker search path.
15 Build the runtime:
16
17 ```shell
18 $ cd rt
19 $ cargo build --release
20 ```
21
22 And then you can either install `rt/target/release/libivy_rt.a` in your library
23 directory of choice, or run the compiler in the Ivy project root directory via:
24
25 ```shell
26 $ env LIBRARY_PATH=rt/target/release cargo run --release
27 ```
28
29 As a shortcut for running a program, you can use `tools/run.py` which will
30 compile and run a source file directly (handling the library path for you),
31 while simultaneously doing pretty-printing of debug output.
32
33 To get pretty-printed debug output on a compiled binary, use `tools/trace.py`
34 to run it.
35
36 ## Testing
37
38 You can use `tools/test.py` to run all of the project tests. It will ensure
39 that the compiler and runtime are properly built before running any filetests.
40
41 Filetests are written to be run by `tools/lit.py`, and checked with
42 `filecheck`. See filetests in the `tests/` directory for examples.
43
44 Recommended `.git/hooks/pre-commit` script:
45 ```bash
46 #!/bin/bash
47 set -e
48 tools/test.py
49 ```