Getting started
ZDeceptron is pre-release. There is no published binary yet, so you build the compiler from source. It needs nothing but a Rust toolchain — no Node, no package manager, no bundler.
Install
git clone https://github.com/DrDrewCain/zdeceptron
cd zdeceptron
cargo build --release
That produces ./target/release/zdc. Check it:
./target/release/zdc --version
# zdc 0.1.0
Your first program
Put this in hello.zd:
state name is client Text starting "world"
view
Column
Heading "Hello, ZDeceptron"
Input name, hint is "your name"
Text name
There is no string interpolation: a value reaches the page by being named, as
Text name does. One phrasing per construct is a rule the language keeps
deliberately.
Build it:
./target/release/zdc build hello.zd -o dist
You now have a dist/ containing exactly this:
client.js index.html manifest.json runtime/ styles.css
Open index.html. Type in the box; the text below it follows.
There is no config file, no bundler entry point and no framework import. The file is the program.
While you work
zdc dev serves the file and rebuilds as you edit, with live reload and
compile errors rendered on the page rather than hidden in a terminal:
./target/release/zdc dev hello.zd
The whole command surface
| Command | What it does |
|---|---|
zdc check | Resolve every name and typecheck. No output written. |
zdc build | Compile into a runnable bundle. |
zdc dev | Serve, rebuilding and reloading as you edit. |
zdc explain | Print the rule behind a diagnostic code. |
zdc parse | Print the syntax tree. |
zdc deploy | Generate everything one platform needs — and report what it cannot do. |
zdc lsp | Language server, over stdin and stdout. |
When something is refused
Diagnostics carry a code, and the code is a question you can ask:
Error: Expected a placement after `is`, found `Whole`.
1 │ state votes is Whole starting 0
│ ──┬──
│ ╰──── `Whole` is the type, and a placement goes before it
│ Help: run 'zdc explain E0101' for the rule
│ Note: the line as it would be accepted: state votes is client Whole starting 0
The inline message stays deliberately short — reading a compiler error costs about as much as reading source code, so the message carries only what you need in order to act. Everything about why a rule exists lives one command away:
./target/release/zdc explain E0101
Next
Read how the language works. It is one idea, and you can hold it in your head in about five minutes.