Skip to content
Konjure / spatial intelligence

Your first Konjure scene

Run the crate-owned activity example, change one value, and inspect the result.

Start with Language basics and Types and traits if you are new to the syntax.

This program is the activity.kj example from crates/konjure-lang. It defines a reusable Spinner with advance and reverse methods. The Rotate system joins each spinner with its transform and calls advance from frame.

Tick 0 · 0.00 sThis device
main.kj⌘ / Ctrl + Enter
Loading…Drag to orbit · select to inspect
0 entities
Loading the language runtime…
Output 0
No output.

Run it

Press Run, then Play or Step. The preview shows the entities; the Debug and Trace tabs show the runtime world and source locations. Select the Reverse control to call its typed function and change every spinner’s direction.

Use Finish to end a run, Run to restart your edited source, and Reset to restore the original files and start again. The lifecycle example also defines init and done, so their output makes the callback order visible.

Change one value

Change one speed argument in a make_spinner call, compile again, and step the program. The changed spinner turns at a different rate. If an edit fails to compile, the workbench reports a diagnostic and preserves the last accepted program until a new compile succeeds.

Try spinner.advance(true) in the system. The compiler expects Number and points to the incompatible argument before any frame runs. Fix the argument back to dt, then compile again.

Run the same source from Rust

From the repository root, the language CLI runs the crate-owned file directly:

Sourcesh
cargo run -p konjure-tools --bin kj-lang -- run crates/konjure-lang/examples/activity.kj --ticks 60

The workbench and CLI use the same Rust language implementation, distributed to the browser through WebAssembly. Continue with the language guide for types, traits, modules, systems, and current limits.