A new implementation of the LOGO programming language, written in Rust.
DynaLOGO's syntax closely follows UCBLogo, extended with dynaturtles — turtles that have velocity as well as position, with real-time collision detection and event "demons" — as described in Seymour Papert's Mindstorms and realized in Atari LOGO and MicroWorlds LOGO.
TO SPACESHIP
TELL 0
SETSHAPE "ship
SETSPEED 20
WHEN TOUCHING [0 1] [EXPLODE]
WHEN EDGE [BOUNCE]
END
- UCBLogo compatibility — rich syntax and a broad compatibility surface, including dynamic scope, templates, macros, property lists, file/workspace tools, Atari LOGO-inspired helpers, and UCBLogo-accurate error messages.
- Dynaturtles — velocity-bearing turtles,
SETSPEED/SETVELOCITY,WHEN TOUCHING/WHEN EDGEcollision demons,BOUNCE/WRAP/FENCEedge modes. - Performance — bytecode VM (not a tree-walker), fixed 60 Hz simulation tick decoupled from rendering, struct-of-arrays turtle storage, spatial-hash collision. Target: 1,000 colliding dynaturtles at 60 Hz.
- Live — the REPL and the simulation run concurrently; typing never freezes moving turtles.
crates/dynalogo-core— lexer, parser, bytecode compiler, VM, values, the dynaturtle sim engine, and both native/cooperative runtime utilitiescrates/dynalogo— native frontend: window, turtle rendering, and REPL
dynalogo-core is headless and has no graphics dependencies.
docs/getting-started.md— the best place to begin if you are new to DynaLOGOdocs/browser-demo.md— running the WASM browser demo locally and how it differs from the native windowdocs/reference-manual.md— user reference for the currently implemented language and dynaturtle surfacedocs/debugging-and-errors.md— practical debugging and error-handling guidancedocs/developer-guide.md— contributor-oriented internals and extension pointsdocs/wasm-and-browser.md— WASM/browser build and embedding guidancedocs/ucblogo-compatibility.md— compatibility corpus, live-UCBLogo harness notes, and intentional divergencesdocs/README.md— documentation indexdocs/versioning.md— versioning policy and changelog processdocs/releasing.md— how GitHub releases are cut
cargo run -p dynalogo --bin dynalogoUseful commands:
help/help "fd— show embedded interactive helpapropos "turtle— search help topicscargo run -p dynalogo --bin dynalogo -- --eval 'print sum 2 3'cargo run -p dynalogo --bin dynalogo < examples/square.lgo
cargo run -p dynalogo --bin dynalogo-windowThe window frontend keeps a small command log at the bottom and renders turtle
lines on a centered Cartesian canvas. The startup log suggests HELP /
APROPOS examples, and the prompt supports command editing with Left/Right,
Home/End, Backspace, Delete, and Up/Down command history.
DynaLOGO includes a browser-oriented macroquad build of dynalogo-window and
an in-page REPL demo shell. The GitHub Pages deployment workflow is currently
manual-only and no-op while a GitHub-hosted release-mode WASM linker failure is
investigated.
You can validate the browser build locally with:
rustup target add wasm32-unknown-unknown
cargo build -p dynalogo --bin dynalogo-window --target wasm32-unknown-unknownThe committed demo shell lives in web/index.html. When Pages deployment is
re-enabled, the workflow should copy that shell, the compiled
dynalogo-window.wasm, and the example .lgo files into the published site
artifact. The shell includes a grouped example gallery dropdown covering every
program in examples/, plus a Starter
snippet; picking one and pressing "Load Example" fills the REPL textarea for
"Run in Demo". It also includes a small browser-side shape editor for building
PUTSH / SETSHAPE commands against the current shape registry.
See docs/browser-demo.md for a full local-serving
walkthrough and an honest list of what differs from the native window (mainly:
no real file I/O, and audio may need a user gesture first).
dynalogo-core also builds for wasm32-unknown-unknown and exposes a
cooperative runtime designed to be advanced from a browser render loop such as
requestAnimationFrame.
You can validate the core build with:
cargo check -p dynalogo-core --target wasm32-unknown-unknownImplemented today:
TO ... ENDprocedures with dynamic scope and recursion- Core control:
REPEAT IF IFELSE RUN RUNRESULT REPCOUNT - Richer v0.3 control:
TEST IFTRUE IFFALSE CATCH THROW ERROR WAIT - Library control structures:
FOR WHILE UNTIL DO.WHILE CASE COND - Lists/words:
FIRST BUTFIRST LAST BUTLAST FPUT LPUT SENTENCE LIST WORD - Data utilities:
COUNT ITEM EMPTYP EQUALP MEMBERP - Arithmetic, infix operators, comparisons, and boolean logic
- Variables and property lists:
MAKE THING LOCAL PPROP GPROP PLIST REMPROP - Arrays and templates:
ARRAY SETITEM LISTTOARRAY ARRAYTOLIST MAP FILTERREDUCE FOREACH APPLY CASCADE CASCADE.2 TRANSFER - Macros:
.MACRO .DEFMACRO MACROP MACRO? MACROEXPAND - File/outside-world helpers:
LOAD SAVE EDIT OPENREAD OPENWRITE OPENAPPENDREADWORD READCHAR READLIST READLINE DRIBBLE ERF CATALOG KEYP JOY PADDLETIMEOUT SETCURSOR SETENV CT; native builds canEDIT "program.lgothrough$EDITOR/$VISUAL(or Notepad on Windows) and evaluate the edited source - Static turtle graphics:
FD BK LT RT SETXY SETPOS SETH HOME CS PU PD PE PXPN SETPN PC SETPC SETC SETBG SETPENSIZE SETSP SETSCRUNCH SETLABELHEIGHTLABEL HT ST POS HEADING XCOR YCOR - Dynaturtle shape surface:
SETSHAPE SHAPE PUTSH GETSH, registry-backed custom-outline rendering, the browser shape editor, and$EDITOR-drivenEDSH
Remaining compatibility notes now live in the reference and compatibility docs;
see docs/reference-manual.md,
docs/ucblogo-compatibility.md, and
docs/atari-logo-validation.md.
See examples/ for runnable programs.
Classic turtle examples:
square.lgo— the smallest turtle demoflower.lgo— procedures + repeated drawingspiral.lgo— arithmetic, variables, and looping
Dynaturtle examples:
shape_parade.lgo— animated turtle / dog / ship shapesdogs_in_the_park.lgo— collision-driven barking withWHENandTOOTspaceship_thrust.lgo— ship-thrust / inertia sketchbouncing_ball.lgo— collision-based bouncing demoorbit_simulation.lgo— orbit-style multi-body trailspong_demons.lgo— a small collision-demon pong sketch
Download the latest prebuilt packages from the
GitHub Releases page.
Packages include both the dynalogo terminal REPL and dynalogo-window
native turtle frontend. See the
Getting Started installation guide
for extraction and first-run commands.
Tagged pushes (v*.*.*) trigger a GitHub Actions workflow that builds native
dynalogo/dynalogo-window binaries for Linux, macOS (arm64), and Windows
and attaches them to a GitHub Release. See
docs/release-process.md for the build matrix and
known limitations (no code signing/notarization, no installers).
The 1.0 release is suitable for experimenting with core Logo, static turtle graphics, Computer Science Logo Style examples, and dynaturtle programs. See ROADMAP.md for the historical version plan, PLAN.md for the architecture, docs/getting-started.md for onboarding, and docs/primitive-inventory.md for a snapshot of the currently implemented primitive surface.
See docs/versioning.md for the version policy and changelog process, and CHANGELOG.md for what's changed.
MIT — see LICENSE.
