Skip to main content

Wickra Compile — compile a strategy spec into a standalone deployable

Built on Wickra Status CI CodeQL codecov GitHub release crates.io PyPI npm NuGet Maven Central Go module R-universe License: MIT OR Apache-2.0 OpenSSF Scorecard OpenSSF Best Practices Build provenance Docs Verified across 10 languages Deterministic manifest


Compile a strategy spec into a standalone deployable: a WASM module, a self-contained binary, or a no_std artifact for microcontrollers. Write once as data, deploy anywhere.

▶ Live demos: the backtester compiled to WebAssembly, an equity curve building bar by bar — backtest-live.wickra.org; one StrategySpec side by side in Python, Rust, JS and Go — playground.wickra.org; all 515 indicators of the core over a real Binance feed — live.wickra.org. Zero backend, all of them.

Part of the Wickra ecosystem: the same data-driven core and ten-language binding surface also power wickra-exchange, wickra-backtest, wickra-terminal and 20 more — see the full list. same StrategySpec that wickra-backtest runs and emits a self-contained project that embeds the spec and calls the Wickra engine — no interpreter, no runtime spec parsing.

Wickra Compile is the output side of strategy authoring: instead of wrestling a Pine-like input language, you write your strategy as a StrategySpec (data), and the compiler generates a standalone Rust project that embeds it verbatim and targets WASM, a native binary, or bare metal. The generated manifest — the list of files with their hashes plus the canonical spec hash — is byte-identical across all ten language bindings and reproducible across runs.

# Print the deterministic manifest for a strategy spec — no toolchain needed.
cargo run -p wickra-compile -- --spec golden/specs/sma_cross.json --manifest

# Generate the project without building it, then inspect it.
cargo run -p wickra-compile -- --spec golden/specs/sma_cross.json --dry-run --out ./out

Status

0.2.3 — the current release. The codegen core, the reference CLI, the ten-language binding surface, the golden corpus and the full CI matrix are in place.

Documentation

How it works

A CompileSpec names a StrategySpec, a target (wasm / binary / no_std), an optimisation level and optional embedded data. The codegen core:

  1. validates the spec (the strategy round-trips as a wickra_backtest::StrategySpec; the crate name and MCU triple are checked against an allowlist);
  2. renders a generated Rust project from embedded templates (the spec is embedded as data, never run through the template engine);
  3. emits a deterministic manifest — every file's SHA-256 and length, the canonical spec hash, and the project hash — in stable path order;
  4. optionally invokes cargo (argv, never a shell) to build the artifact.

Determinism

The manifest is the golden moat: BTreeMap everywhere in the output path, stable path-sorted file lists, no RNG, no timestamps, canonical spec serialisation before hashing. The same CompileSpec + target produces a byte-identical manifest on every run and in every language binding. (The compiled binary bytes are only reproducible with a reproducible-build toolchain — that is best-effort and separate from the manifest guarantee.)

Quickstart

# Print the deterministic manifest for a strategy spec — no toolchain needed.
wickra-compile --spec golden/specs/sma_cross.json --manifest

# Generate the project without building it, then inspect it.
wickra-compile --spec golden/specs/sma_cross.json --dry-run --out ./out

# Retarget the same spec without editing it.
wickra-compile --spec golden/specs/sma_cross.json --target wasm --opt size

Use in any language

The same handle + command_json + version surface ships for Rust, Python, Node.js, WASM, and — over a C ABI hub — C, C++, C#, Go, Java and R. Each binding passes the command string through verbatim, so the manifest they return is identical.

import json
from wickra_compile import Compiler

spec = open("golden/specs/sma_cross.json").read()
out = json.loads(Compiler().command(f'{{"cmd":"compile","dry_run":true,"spec":{spec}}}'))
print(out["manifest"]["project_hash"])  # identical in every binding

See examples/ for the same program in all ten languages.

Project layout

crates/compile-core   the library: spec, canonical JSON, codegen, manifest
crates/compile-cli    the wickra-compile CLI
crates/compile-bench  criterion micro-benchmarks
bindings/*            ten language surfaces (c, python, node, wasm, csharp, go, java, r)
golden/               specs + blessed manifests (the cross-language corpus)
examples/             one runnable example per language
docs/                 architecture, spec, targets, determinism, templates, cookbook

Building everything from source

cargo build --workspace
cargo test  --workspace --all-features
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo run -p wickra-compile -- --spec golden/specs/sma_cross.json --manifest

Each binding builds from its own directory — see the per-binding READMEs under bindings/. The operating-mode test builds the generated no_std project for real, so rustup target add thumbv7em-none-eabihf before cargo test.

Testing

Run the suites with the commands in Building everything from source.

  • wickra-compile-core — unit tests per template and target, canonical determinism (a spec in any key order hashes the same), property tests over specs and the command envelope, and the operating-mode check: the manifest a dry run describes is the manifest a real build builds (the no_std project, which has no dependencies and compiles in seconds). The golden fixtures in golden/ are the anchor: every spec must produce the same manifest bytes here as in every binding.
  • Every binding asserts the same golden manifest and the same operating-mode equivalence (the WASM build, which carries no toolchain, checks key-order independence instead of a real build). That is the whole cross-language claim, so it is checked the same way in each one rather than approximated per language: Python with pytest (and a plain runner on 3.9), Node with node --test, WASM through the nodejs build, C and C++ through ctest, C# with dotnet test, Go with go test, Java with JUnit, and R with the shipped tests/smoke.R plus the repository's run_tests.R.
  • Examples — every example under examples/ runs in CI and is held to the version and the project_hash it prints.
  • Real builds — the nightly build-targets job cross-compiles a generated project per target family (wasm32, thumbv7em) with the CLI.
  • Fuzz — fuzz/ holds libFuzzer targets over spec and target parsing, the canonical hash and the codegen; CI runs each for a short smoke.

Requirements

  • Rust 1.86+ — the workspace MSRV; the Node binding needs Rust 1.88. Building a generated artifact additionally needs its target toolchain (wasm32-unknown-unknown for WASM, a thumbv* target for no_std).
  • Python 3.9+ — the Python binding.
  • Node 22+ — the Node binding.
  • Go 1.23+ — the Go binding.
  • Java 22+ — the Java binding.
  • R 4.1+ — the R package.
  • .NET 8+ — the C# binding.
  • A C11 / C++17 compiler with CMake 3.15+ for the C and C++ examples.

See each bindings/<lang>/README.md for the per-language build and install.

Benchmarks

Codegen is pure data templating and hashing — tens of microseconds, no compilation. See BENCHMARKS.md; reproduce with cargo bench -p compile-bench.

Ecosystem

Part of the Wickra family — each one a data-driven core with a CLI and the same ten-language binding surface:

  • wickra — main library (Rust core + Python / Node.js / WASM bindings + a C ABI for C / C++ / C# / Go / Java / R)
  • wickra-playground — a polyglot strategy playground: one StrategySpec live side by side in Python, Rust, JS and Go, entirely in the browser
  • wickra-exchange — unified market-data + execution across ten crypto exchanges
  • wickra-backtest — event-driven backtester over the Wickra core
  • wickra-terminal — the trading terminal: a TUI and a browser renderer over the stack
  • wickra-screener — parallel multi-symbol screening over 495 streaming indicators
  • wickra-xray — market-microstructure explorer: footprint, order-book heatmap, liquidation map, funding/OI divergence
  • wickra-copilot — local market copilot grounded in real order-book, liquidation and funding microstructure
  • wickra-shazam — match an asset's current microstructure fingerprint against its entire history
  • wickra-benchmark — reproducible, golden-verified benchmark suite — recompute any (strategy, dataset, report) in ten languages and confirm it byte-for-byte
  • wickra-strategy-ci — Jest for trading strategies: golden-pin the report, catch regressions in CI, property-test against fuzzed data
  • wickra-verify — confirm or refute a claimed backtest report against its strategy and data, in ten languages
  • wickra-proof — Proof-of-Backtest: deterministic (spec, data) → report + blake3 hash, recomputable byte-for-byte in ten languages
  • wickra-zk — prove a backtest zero-knowledge — on-chain-verifiable performance without revealing the data or the strategy
  • wickra-impact — the backtester that knows you would have moved the market: agent-based fills on the real historical L2 order book
  • wickra-darwin — evolutionary strategy search at millions of backtests per second, mutating and crossing JSON specs across the 495-indicator space
  • wickra-gym — a Gymnasium-compatible, microstructure-aware backtest environment with O(1) steps for deterministic RL rollouts
  • wickra-feature-store — OHLCV and microstructure streams into ML-ready feature matrices over 495 O(1) streaming indicators
  • wickra-genome — a vector database of the whole market: every asset a 495-dim live vector, for similarity search, clustering and anomaly detection
  • wickra-timemachine — scrub the whole market like a video — every symbol, full order book, rewound to any moment via deterministic re-fold
  • wickra-synth — deterministic synthetic market microstructure: OHLCV, order book, trades and funding from a single seed
  • wickra-radar — a liquidation-cascade early-warning radar over open interest, funding, order-book and liquidation events
  • wickra-embed — allocation-free, no_std streaming indicators for bare-metal and HFT, byte-for-byte identical to the core
  • wickra-pico — the O(1) indicator core running bare-metal on a $5 Raspberry Pi Pico — the LED blinks on the EMA cross

Docs at docs.wickra.org; the marketing site and in-browser demo at wickra.org.

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md and THREAT_MODEL.md. The compiler generates code and can invoke cargo on it — run it only on trusted specs.

License

Licensed under either of

at your option. Use it, fork it, modify it, redistribute it — commercially or not — file issues, send pull requests; all welcome.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Disclaimer

Wickra Compile is a code-generation tool, provided "as is" without warranty of any kind. It generates projects and can invoke cargo to build them — run it only on specs you trust. Nothing here is financial advice; compiled strategies are your responsibility, and trading carries risk of loss.


GitHub stars GitHub forks GitHub issues

Built on Wickra. If it saved you time, the cheapest way to say thanks is to ⭐ the repo.

wickra-compile star history

Metadata

Release files for wickra-compile 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wickra-compile 0.2.3
File Size Uploaded Provenance Actions
wickra_compile-0.2.3.tar.gz 65.0 kB Without provenance Details for wickra_compile-0.2.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for wickra-compile 0.2.3
File Actions
wickra_compile-0.2.3-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details for wickra_compile-0.2.3-cp39-abi3-win_arm64.whl
wickra_compile-0.2.3-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for wickra_compile-0.2.3-cp39-abi3-win_amd64.whl
wickra_compile-0.2.3-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details for wickra_compile-0.2.3-cp39-abi3-musllinux_1_2_x86_64.whl
wickra_compile-0.2.3-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details for wickra_compile-0.2.3-cp39-abi3-musllinux_1_2_aarch64.whl
wickra_compile-0.2.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for wickra_compile-0.2.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
wickra_compile-0.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for wickra_compile-0.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
wickra_compile-0.2.3-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for wickra_compile-0.2.3-cp39-abi3-macosx_11_0_arm64.whl
wickra_compile-0.2.3-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for wickra_compile-0.2.3-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 3.5 MB

Release files / wickra_compile-0.2.3.tar.gz

Download URL wickra_compile-0.2.3.tar.gz
Size 65.0 kB
Tags Source
SHA-256 checksum
How to use checksums
10cb31df2aa6db95a3e3dced9da6c49214cd98ae0a0d6cc7c95e89115d739d0c
BLAKE2b-256 checksum
How to use checksums
394966cbb6a9f1a3de0d78b96e19da22f3fcdceacdae3f2b65012783da0ab596
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_compile-0.2.3-cp39-abi3-win_arm64.whl

Download URL wickra_compile-0.2.3-cp39-abi3-win_arm64.whl
Size 329.3 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
82e20cf4eb52b44408cadd1f5dfb2c188dd74d761a6188d29ee81c75d9783c3f
BLAKE2b-256 checksum
How to use checksums
876780a3a24306e31a19a038a764bab76d36232065e3c4ac7b39afb541c8c2c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_compile-0.2.3-cp39-abi3-win_amd64.whl

Download URL wickra_compile-0.2.3-cp39-abi3-win_amd64.whl
Size 351.2 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1b2f454f314295a9263a7ee429122472a912e8b85165ab0644c661f24f4535cf
BLAKE2b-256 checksum
How to use checksums
26f521f7d07a4441de9502e4299941f918a7852b453863af80026fb43bfd6dea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_compile-0.2.3-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL wickra_compile-0.2.3-cp39-abi3-musllinux_1_2_x86_64.whl
Size 633.2 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
af19dfba641ac1bde2550b897c26b51cace4230da6ba437ba24860b01d1c81c9
BLAKE2b-256 checksum
How to use checksums
83b6f0f1ee0e1321c0383b718e2b40e97dd3a377d4bab45aa74a94b5f386fab4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_compile-0.2.3-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL wickra_compile-0.2.3-cp39-abi3-musllinux_1_2_aarch64.whl
Size 573.5 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
eafc64d9219bab414481a0905fb08e644dad9ba7fac2eb93de44ff677f703668
BLAKE2b-256 checksum
How to use checksums
78067aab6919ec02c35a9ebb2c9463fe101fd636c8fa1d89bd1ed5a99a917d89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_compile-0.2.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL wickra_compile-0.2.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 422.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
43968e96a621dc05888bf6c2b582e46d03fd1ee00f6903618a4ec5ffd9bb056e
BLAKE2b-256 checksum
How to use checksums
91b9c33e1b0eeb488c6dc027d44a1b3de2d08e7c96549b0839457c5720cb9a29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_compile-0.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL wickra_compile-0.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 396.2 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ea8fcb6965681713e8d1e4fe00ea42cc2a8774ced31c23b2ddba3bf9bf5a7c0e
BLAKE2b-256 checksum
How to use checksums
131468a4d478c19d8df9116210e8b6ac808d38edb681c7d5182887326c302e06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_compile-0.2.3-cp39-abi3-macosx_11_0_arm64.whl

Download URL wickra_compile-0.2.3-cp39-abi3-macosx_11_0_arm64.whl
Size 368.1 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fadd40baf4873f5f0c3d84d0eca6b5315322e48ae62cb983b9922aeaa70052b7
BLAKE2b-256 checksum
How to use checksums
a972c9db9b3a84b95b0ab1ef91457cb0d70e31c052585bf9f7ef27905daef952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / wickra_compile-0.2.3-cp39-abi3-macosx_10_12_x86_64.whl

Download URL wickra_compile-0.2.3-cp39-abi3-macosx_10_12_x86_64.whl
Size 405.7 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
2838e083bec8850d5407b79a204b70b4ba8e6f68f427b5c9cd2d2971eb1c200d
BLAKE2b-256 checksum
How to use checksums
b59473d58292a1ef370be34a5d7f1e9fc24b72934545ef1d71a88cd9efaef73c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for wickra-compile 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page