Compilers that build Brickadia wire graphs from code:
- Wirescript - a language that compiles to wire graph saves. Try it in the browser at wirescript.brickadia.dev.
- (Old, outdated) Bearilog - a module builder CLI for generating logic bricks.
This project requires rust v1.88 or later.
The playground writes, formats, and
compiles Wirescript to .brz entirely in the browser, with searchable docs
(Ctrl-K) and a downloadable SDK (Node.js CLI tools, examples, and a VS Code
extension).
Every var becomes a Variable gate, every operator becomes an expression
gate, and every on handler becomes an exec chain:
var count: int = 0
in trigger: exec
on trigger {
count = count + 1
}
out total = count.Value
out doubled = count.Value * 2
- Pure + exec contexts: signal-flow expressions and sequential
onhandlers var/static var/let/buffer(one-tick delay) bindings- Records, tuples, destructuring, and spread
modmacros with ref params andchipmicrochip grouping- Imports across files: named, namespace (
import * as u), and transitive await,Sleep/SleepTicks, local exec signals, andemit- Receiver method syntax:
entity.SetLocation(...),a.Dot(b) - Typed arrays with 20+ built-in methods
- Vector and quaternion math with component-wise arithmetic and scalar broadcast
$assetsyntax and near-full coverage of Brickadia's logic gates- LSP + VS Code extension: diagnostics, hover, completions, go-to-definition, formatting, rename, organize imports, and inlay hints
The language reference lives in docs/wirescript/. The
compiler is crates/wirescript, the LSP server is crates/lsp, the browser
playground is crates/wasm, and the editor extension is editors/vscode.
This will build a module and output it to a BRDB file.
cargo run ./examples/cpu reg64_16 -o example.brdbRender as a big blob of bricks
cargo run ./examples/cpu reg64_16 -o example.brdb --layout grid --inline
cargo run ./examples/7seg bitwise7seg -o 7segbit.brdb --layout grid --iobelowThis will build a module and print out its structure
cargo run ./examples/cpu reg64_16Output for a browser:
cargo run ./examples/cpu reg64_16 -gRender from CLI:
cargo run ./examples/cpu reg64_16 -g | dot -q -Tsvg > output.svg