Repository navigation
Home
_ __
| '_ \ ρ (RHO) 1.0.0
| |_) | an array language in the line of APL
| .__/ one source → a native kernel, a JAX module, a circuit
|_|
ρ is an array language in the line of APL, compiled to native kernels. A
program declares grids and writes flows over them, whole: a shift reads a
neighbour, a fold collapses an axis, a scan runs along one, a lift stretches one
array against another, ⇒ repeats a flow to a fixed point. Shapes are declared,
so one source becomes three things — a native kernel, a JAX module, a circuit —
and every one of them is held to a reference interpreter.
{
/* Jacobi: relax X until no cell moves by more than 𝜏 */
INPUT:◯ □ 64 64
INPUT → X
((INPUT / 4.0) + ((▷X + ▽X + ▷0X + ▽0X) / 4.0)) ⇒ X
X → =
}
rhoc jacobi.rho --tau 1e-12 --max-iter 200 --run INPUT=field.bin --write OUTPUT=out.bin| Target | How | Held to the interpreter |
|---|---|---|
A native kernel (.so, C ABI, Python) |
rhoc program.rho |
bit for bit, at f64 and f32, with every sweep split across threads |
| A JAX module for CPU, GPU, TPU | rhoc program.rho --emit-jax m.py |
bit for bit where XLA allows; within one ulp at the scale of the space where XLA reorders a fold or uses its own exp
|
| A SystemVerilog pipeline, one cell per clock | rhoc program.rho --emit-sv dir --fixed 32.16 |
bit for bit, in real and in fixed point; Yosys and nextpnr synthesise it |
Image filters and morphology, stencil PDE relaxation and diffusion,
reaction–diffusion and cellular automata, Monte Carlo and procedural noise,
small linear algebra (products, norms, softmax, layer normalisation), lookup
and colour maps, FIR filtering and pulse shaping, distance fields — and the
same programs as FPGA datapaths. Left out by decision: scatter, sort, strings,
nested arrays, data-dependent branching beyond ⇒, an integer type, FFT.
- Getting-Started — install, compile, run from the command line, call from Python
- Syntax-Reference — every glyph, its ASCII alias, and what it means
-
Verification — the reference interpreter, the differential test, the circuit leg, and what
!checks
The repository's README states what ρ can do, what it claims and how each claim is checked; these pages are the reference.
1.0.0. The language as specified, the three targets, the C ABI and the Python
package, rhoc --run, the checks — 158 tests, a differential test on every
push, wheels for Linux and Windows. Apache 2.0, Shogo Toda.
ρ (RHO) Language 1.0 · Apache-2.0 · Shogo Toda · Repository