]> Witch of Git - ivy/summary
 
descriptionLittle lambdas eat ivy.
last changeSun, 7 Feb 2021 08:30:08 +0000 (03:30 -0500)
readme

Ivy

Little lambdas eat ivy.

Ivy is an impure functional language that compiles to native code. It was developed as an educational project to learn more about compiling functional languages, and compiling without going through frameworks like LLVM that handle the backend. It currently supports x64, and requires clang as an assembler.

Setup

Running the compiler requires the Ivy runtime be on the linker search path. Build the runtime:

$ cd rt
$ cargo build --release

And then you can either install rt/target/release/libivy_rt.a in your library directory of choice, or run the compiler in the Ivy project root directory via:

$ env LIBRARY_PATH=rt/target/release cargo run --release

As a shortcut for running a program, you can use tools/run.py which will compile and run a source file directly (handling the library path for you), while simultaneously doing pretty-printing of debug output.

To get pretty-printed debug output on a compiled binary, use tools/trace.py to run it.

Testing

You can use tools/test.py to run all of the project tests. It will ensure that the compiler and runtime are properly built before running any filetests.

Filetests are written to be run by tools/lit.py, and checked with filecheck. See filetests in the tests/ directory for examples.

Recommended .git/hooks/pre-commit script:

#!/bin/bash
set -e
tools/test.py
shortlog
2021-02-07 Cassie Jones[tools] Add tools/test.py as the project test runner develop
2021-02-07 Cassie Jones[Docs] Mention run.py and trace.py in the README
2021-02-07 Cassie Jones[tools] Format code
2021-02-07 Cassie Jones[tools] Move ANSI color printing code into its own...
2021-02-07 Cassie Jones[tools] Add tools/lit.py
2021-02-07 Cassie Jones[Parser] Support code with trailing comments
2021-02-07 Cassie Jones[tools] Make tools directly executable
2021-02-07 Cassie Jones[tools] Add tools/run.py to compile and immediately...
2021-02-07 Cassie Jones[test] Add a filecheck program
2021-02-07 Cassie Jones[NFC] Formatting
2021-02-06 Cassie Jones[rt] More misc fixes
2021-01-03 Cassie Jones[rt] Misc small cleanups
2021-01-02 Cassie Jones[rt] Change is_<type> predicates to tag checks
2021-01-02 Cassie Jones[rt] Change destructor decref to use immutable slices
2021-01-02 Cassie Jones[rt] Split the runtime into multiple modules
2021-01-02 Cassie Jones[rt] Make Obj variant padding explicit
...
heads
3 years ago develop