Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 803 Bytes

NIX.md

File metadata and controls

34 lines (27 loc) · 803 Bytes

Usage (Nix)

1. Build and install HVM

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

git clone https://github.com/Kindelia/HVM.git
cd HVM
# Build HVM
nix build
# Install it to your Nix profile
nix profile install

2. Create an HVM file

Same as step 2 of the "Usage" section.

3. Run/compile it

# Interpret the main.hvm file, passing 10 as an argument
hvm run main.hvm 10
# Compile it to C
hvm compile main.hvm
# Initialise the Nix development shell
nix develop
# Compile the resulting C code
clang -O2 main.c -o main -lpthread
# Run the resulting binary, passing 30 as an argument
./main 30