Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Latest commit

 

History

History
35 lines (28 loc) · 908 Bytes

NIX.md

File metadata and controls

35 lines (28 loc) · 908 Bytes

Usage (Nix)

1. Access/install HVM

Install Nix and enable Flakes then, in a shell, run:

git clone https://github.com/HigherOrderCO/HVM.git
cd HVM
# Start a shell that has the `hvm` command without installing it.
nix shell .#hvm
# Or install it to your Nix profile.
nix profile install .#hvm

2. Create an HVM file

Same as step 2 of the "Usage" section.

3. Run/compile it

# Interpret the main.hvm file, passing "(Main 25)" as an argument.
hvm run -f main.hvm "(Main 25)"
# Compile it to Rust.
hvm compile main.hvm
cd main
# Initialise the Nix development shell.
nix develop .#hvm
# Compile the resulting Rust code.
cargo build --release
# Run the resulting binary.
./target/release/main run "(Main 25)"