Bimetal documentation
Read these in order if you're new. Each page assumes the ones before it and defines its own terms.
- Tutorial writes a small Rust library, then calls it from Python and TypeScript. It takes about ten minutes once the tools are installed.
- Concepts explain how Bimetal thinks, without code you need to memorize:
- The contract: what Bimetal reads from your Rust
- Packages and projects: which files are yours, and which are Bimetal's
- Hosts: the Python extension, the Wasm module and the Node.js addon
- How values cross: what each value costs at the boundary
- Resources: Rust values that outlive one call
- Async calls: which runtime runs them, and when they start and stop
- Failures: errors, bad arguments, panics and traps
Guides
Look these up when you need them.
| To work with | Read |
|---|---|
| Functions, constants, namespaces and default arguments | Functions |
| Structs, enums and field rules | Models |
| Errors that callers branch on | Errors |
| Classes that keep a Rust value | Resources |
with, for, properties and len() |
Protocols |
async fn and Tokio |
Async |
| Host functions that Rust calls | Callbacks |
| Byte strings and numeric arrays | Bytes and buffers |
| Arrow arrays, batches, tables and streams | Arrow |
| Web pages and bundlers | Browsers |
| The native addon and Electron | Node.js |
| Several crates, or projects outside the crate | Workspaces |
| CI, merges and fresh clones | Keeping packages current |
| PyPI and npm | Publishing |
| A large crate you didn't write | Wrapping a large project |
The white paper
The white paper describes what Bimetal is and why we wrote it: how one contract reaches three hosts, what each boundary promises, how the output stays reproducible, what that costs, and where its limits are. Read it if you want to judge the design rather than use it.
Reference
- Commands: every command, flag and JSON report
bimetal.toml: every setting- Attributes: every
#[bimetal(...)] - Types: every Rust type, and what each host sees
- Names: how names change per host, and which are refused
- Generated files: what Bimetal writes, owns and deletes
- Limits and requirements: versions, limits and what Bimetal doesn't do yet
- Prior work: the work Bimetal builds on
Internals
For anyone changing the code. They walk through one operation at a time.
- The crates: what each crate and module does
- The life of a build
- The life of a call
- Resources and callbacks
- Reproducible output
- Testing: the commands, the test layers, and which test guards which promise
- Releases