Sheet-lang is a typed dataflow language for node sheets. A sheet is a graph of nodes; each node holds a formula (Excel-style functions on typed values) or a small program, and the nodes' outputs feed other nodes' inputs. Sheet-lang checks types and units, runs the graph incrementally, and keeps going when part of the input is not known yet.
Status: experimental. The syntax, the IR and the stored workspace format may change without notice. All crates are
publish = falsefor now.
input 売上: Table<地域: Text, 金額: Int>
let 東 = query {
from 行 in 売上
where 行.地域 = "東"
}
output n = ROWS(東)
fn factorial(n: Int) -> Int { if n <= 1 { 1 } else { n * factorial(n - 1) } }
factorial(10)
- Excel-compatible built-ins (
SUM,MAP,REDUCE, dates, text, lookup, statistics, finance) next to ordinaryfn,let,var,whileandfor. - Static types with units, decimals, vectors, tables and relations;
queryblocks over tables. - Algebraic effects (
effect,perform,handle … with) for errors, inputs and requests. - Holes: a value that is not known yet (
?x) is carried through, so a run reports what it could compute and what it still waits for. - Rules and search:
logic { … }with objectives, evaluated byderiveorsolve. - Incremental, budgeted and cancellable evaluation.
| Crate | Role |
|---|---|
sheet-lang-parol |
grammar (sheet.par), generated parser, syntax tree and syntax errors |
sheet-lang-model |
types, units, decimals, values, IR, stable ids, node graph and workspace |
sheet-lang-compiler |
incremental compiler on query-flow: name resolution, type checking, lowering, editor services |
sheet-lang-runtime |
IR interpreter, standard library, incremental and cancellable evaluation on whale |
sheet-lang-test-suite |
Eure case files that specify what the parser, checker, evaluator and editor services answer |
The toolchain is pinned in rust-toolchain.toml (a nightly; rustup installs
it on first use).
cargo test --locked --workspace
cargo test -p sheet-lang-test-suite --test cases -- <filter> # run matching cases
cargo clippy --workspace --all-targets --locked -- -D warningsThe behaviour of the language is specified by the case files under
crates/sheet-lang-test-suite/cases/ (syntax, types, eval, editor). To add
a behaviour, add a case there.
The parser is generated from crates/sheet-lang-parol/sheet.par by parol and
committed under crates/sheet-lang-parol/src/generated/. parol runs only in
tools/sheet-lang-parol-gen, a workspace of its own with its own lockfile.
bash scripts/generate-sheet-lang-parol.sh # regenerate
bash scripts/generate-sheet-lang-parol.sh --check # fail if the committed files are stale.cargo/config.tomlrefuses crate versions published less than 14 days ago (enforced by the nightly Cargo pinned inrust-toolchain.toml)..gitignoreis an allowlist: everything is ignored unless allowed. Check it when you add a new kind of file.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.