GitHub Actions Bot 6284e1ed8d open-sourcing wallet and choo upgrades to build jam files at compile-time 9 hónapja
..
bootstrap 6284e1ed8d open-sourcing wallet and choo upgrades to build jam files at compile-time 9 hónapja
src 6284e1ed8d open-sourcing wallet and choo upgrades to build jam files at compile-time 9 hónapja
tests 0399db879c Initial open-sourcing 9 hónapja
Cargo.toml 6284e1ed8d open-sourcing wallet and choo upgrades to build jam files at compile-time 9 hónapja
README.md 6284e1ed8d open-sourcing wallet and choo upgrades to build jam files at compile-time 9 hónapja
bootstrap.rs 0399db879c Initial open-sourcing 9 hónapja

README.md

Choo: compile hoon

To self-bootstrap:

cargo run --release bootstrap/kernel.hoon ../hoon-deps

This will save the built kernel as out.jam in the current directory. This should be moved to the bootstrap directory so the choo binary can pick it up:

mv out.jam bootstrap/choo.jam

Once this is done, you should be able to run

cargo build --release

and use the resulting binary in target/release/choo (in the nockapp directory) to build NockApp kernels or arbitrary hoon files as detailed in the following section.

Usage

The following assumes you have the choo binary in your path, which can be built with cargo build --release and found in target/release/choo.

For choo, the first argument is the entrypoint to the program, while the second argument is the root directory for source files.

choo main.hoon hoon/

Building Arbitrary Hoon

To build arbitrary Hoon files, use the --arbitrary flag:

# Create a directory for your Hoon files
mkdir hoon

# Create a simple Hoon file
echo '%trivial' > hoon/trivial.hoon

# Build the Hoon file (exclude --new if you want to use the build cache)
choo --new --arbitrary hoon/trivial.hoon

Hoon

Choo supports the Hoon language as defined in /sys/hoon. However, the build system does not replicate Urbit's +ford functionality exactly, as that is closely tied to the Urbit Arvo operating system. choo supports the following build runes:

  • /+ load from /lib
  • /- load from /sur (currently discouraged in NockApps)
  • /= load from specified path (required %hoon mark)
  • /* load from specified path via specified mark (presumptively %hoon or %jock)
  • /# load and kick from /dat. Used when you have some nock computation you want to precompute.
  • /? version pinning (ignored)

Developer Troubleshooting

If you make changes to the poke arm in bootstrap/kernel.hoon or in hoon-deps/wrapper.hoon, you'll need to update the choo.jam file by running:

cargo run --release bootstrap/kernel.hoon ../hoon-deps
mv out.jam bootstrap/choo.jam

and committing the changes to choo.jam so that the CI can properly bootstrap the choo kernel.