Catalog app · RISC-V VM
Run numbat in the browser
A statically typed language and calculator for scientific computations with physical units.
Try it live
Nothing is downloaded until you press Run.
Evaluate an expression
Installs numbat 1.23.0 from the signed catalog (every chunk is verified before it is written), then runs the commands below in the VM's shell.
bash
numbat --version numbat --no-prelude -e '2 + 3 * 4'
Expected output
$ numbat --version numbat 1.23.0 $ numbat --no-prelude -e '2 + 3 * 4' 14
What it is
numbat checks dimensions at compile time and converts units automatically, so 3 km / 20 min -> mph gives a speed and adding a length to a time is a type error. It ships a large library of units and constants.
Package facts
- version
1.23.0- runs on
- RISC-V VM (
elf-app,riscv64gc-linux-musl) - download
- 2.6 MB compressed · 1 file
- command
numbat- requires
- nothing else — a static binary
- license
MIT OR Apache-2.0(upstream)- upstream
- github.com/sharkdp/numbat
- categories
- Math
- catalog
- generation 12, Ed25519-signed
Install and run it from your page
With the SDK, installApp resolves numbat in the signed index, fetches its content-addressed chunks from the CDN, verifies each one and writes the files into the VM. Details in Installing catalog apps.
javascript
import { createNano } from "@userland-run/nano-sdk";
const nano = await createNano({ image: { wasm: "/nano/console.wasm" }, ramMB: 512 });
await nano.installApp("numbat"); // signature-verified, cached in OPFS
const r = await nano.shExec("numbat --version");
console.log(r.stdout);Typical usage of the upstream command-line tool:
bash
numbat -e '3 km / 20 min -> mph'
Caveats
- Loading numbat's prelude — the standard library with all units and constants — fails on NanoVM v0.2.1 with a datetime parsing error (
-4713-11-24in the Julian-date module), so unit conversions such as1 mile -> kmdo not work yet. The live sample runs with--no-prelude.