tools for working with chialisp language; compiler, repl, python and wasm bindings
Maintained. Last release 16 months ago, commits in 19 of the last 26 weeks. Weaker on recent releases and release cadence.
pip install clvm-tools-rsclvm_tools_rs
Theory of operation of the modern compiler: ./HOW_CHIALISP_IS_COMPILED.md
This repo can be installed via cargo
cargo install clvm_tools_rs
or via pip
pip install clvm_tools_rs@git+https://github.com/Chia-Network/clvm_tools_rs.git@e17412032aa7d3b8b1d1f931893fb5802eee626a
Note: pip installs a subset of the tools installed by cargo, including brun, run, opc and opd.
The most current version of the language is in the nightly branch:
[nightly](https://github.com/Chia-Network/clvm_tools_rs/tree/nightly)
To install from a specific branch:
cargo install --no-default-features --git 'https://github.com/Chia-Network/clvm_tools_rs' --branch nightly
To install a git checkout into your current python environment (must be in some kind of venv or conda environment):
git clone https://github.com/Chia-Network/clvm_tools_rs
cd clvm_tools_rs
maturin develop
Install from PYPI:
pip install -i https://pypi.chia.net/nightlies/ clvm_tools_rs
Most people still compile chialisp via python. One way to set up compilation in that way is like this:
import json
from clvm_tools_rs import compile_clvm
def compile_module_with_symbols(include_paths,source):
path_obj = Path(source)
file_path = path_obj.parent
file_stem = path_obj.stem
target_file = file_path / (file_stem + ".clvm.hex")
sym_file = file_path / (file_stem + ".sym")
compile_result = compile_clvm(source, str(target_file.absolute()), include_paths, True)
symbols = compile_result['symbols']
if len(symbols) != 0:
with open(str(sym_file.absolute()),'w') as symfile:
symfile.write(json.dumps(symbols))