The programming language that reads like plain English.
Build desktop apps and 2D games without the cryptic syntax. Statically typed, garbage
collected, batteries included. Files end in .pt.
make function called greet(name: Text) {
print("Hello, {name}!")
}
greet("world")
PlainText favors real words over symbols (and/or/not, is not nothing), infers your
types so you rarely write them, and includes native APIs for 2D games and desktop UIs — all
backed by a Rust interpreter wrapping Raylib.
- Reads like English.
make function called,for every item in items,repeat 3 times. - Catches mistakes early. A real type checker, but inference means you almost never write a type.
- Games built in.
game { on update … on draw … }, drawn natively, with a scrolling camera, sprite-sheet animation, and particle bursts.import gamekitadds gravity, solid bodies, hitboxes, and character-grid tilemaps — with aplaintext edit_tilemappainter to lay out levels visually. Sound effects and streamed music (volume / pitch / pan / fade) included. - Real desktop UIs.
window { column { button … text_field … } }with scroll areas, lists, dropdowns, checkboxes, sliders, and multiline text — bound straight to your variables. - Batteries included. Math, lists (map/filter/fold-style tools), dictionaries, text, files, time, timers, console input, and
save/loadfor structured progress that survives restarts. - Train a neural network.
import ai, thenneural_network(...),.train(...),.predict(...)— even watch it learn live in a game window, or train on a GPU (device: auto, covering NVIDIA / AMD / Apple). Load training data from a.csvwithload_dataset(...), or from a folder of labeled images withload_image_dataset(...). - Ship a single app.
plaintext build game.ptbundles your program into a standalone executable (Windows, macOS, or Linux). - No memory management. Garbage collected — you never think about it.
New here? Start with GETTING-STARTED.md.
- Download the latest release for your OS
(
plaintext-windows-x64.zip,plaintext-macos-arm64.zip,plaintext-macos-x64.zip, orplaintext-linux-x64.zip). - Unzip it and run the setup script for your OS from that folder —
bash scripts/install-macos.sh,bash scripts/install-linux.sh, orpowershell -ExecutionPolicy Bypass -File scripts\install-windows.ps1— to putplaintexton your PATH. - Run something:
plaintext run examples/basics.pt # run a program
plaintext check examples/basics.pt # check for errors without running
plaintext build examples/basics.pt # bundle into a standalone app
plaintext edit_tilemap examples/tilemap.pt # paint a level (rewrites the file)
plaintext repl # try expressions interactively
plaintext new mygame # scaffold a new project
VS Code: install the CLI and plaintext-lang.vsix from the release zip
(two steps — see editors/vscode/README.md).
The extension needs plaintext on your PATH for red squiggles / hover / go-to-def.
|
A desktop UI |
A 2D game |
See examples/README.md for the full index. Highlights:
| File | What it shows |
|---|---|
examples/basics.pt |
Core language (functions, classes, loops, Dynamic) |
examples/stdlib.pt |
import math, collection methods |
examples/list_tools.pt |
Multi-file import + list tools |
examples/catch.pt |
Complete arcade game |
examples/platformer.pt |
import gamekit platformer |
examples/enemies.pt |
Spawn enemy bodies in a list, world.remove on death |
examples/tilemap.pt |
Text-row tilemap levels + menu/play screen |
examples/form.pt |
Desktop form UI |
examples/scroll_list.pt |
Scroll, list, dropdown, multiline text |
examples/audio.pt |
Sounds, looping SFX, streamed music, fade |
examples/camera_sheets.pt |
Camera follow + sprite-sheet frames + HUD |
examples/save.pt |
save / load progress across runs |
examples/fetch.pt |
import web (offline JSON) |
examples/learn.pt |
import ai — train, GPU, save/load |
examples/dataset.pt |
Train from CSV + accuracy |
examples/image_dataset.pt |
Train from a folder of labeled images |
examples/evolve.pt |
Neuroevolution in a game window |
- docs/README.md — start here (lesson map)
- docs/learn/ — teacher-style lessons (hello → games, UI, and neural nets)
- CHEATSHEET.md — dense, searchable syntax reference
- docs/language-reference.md — full reference
- docs/troubleshooting.md — common errors (old binary,
import math, …)
Math helpers require import math. Prefer increase / decrease and word comparisons
(is at least, …) when they make the code clearer.
A VS Code extension lives in editors/vscode/: syntax highlighting plus a
language server (plaintext lsp) for errors, hover, go to definition, and completions.
The plaintext binary must be on your PATH (see editors/vscode/README.md).
For the .pt icon in Windows File Explorer / on the desktop:
powershell -ExecutionPolicy Bypass -File scripts\install-pt-icon.ps1
Needs the Rust toolchain.
- Windows: LLVM/
libclang+ MSVC build tools. Copy.cargo/config.toml.exampleto.cargo/config.tomland setLIBCLANG_PATH. - macOS: Xcode Command Line Tools (
xcode-select --install). - Linux (Debian/Ubuntu): install Raylib/bindgen deps — see the
apt-getlist in GETTING-STARTED.md.
cargo build # interpreter at target/debug/plaintext
cargo install --path . # install `plaintext` onto your PATH
Build a distributable Windows zip with scripts\package-release.ps1. Tagged releases
(v2.12.1, …) are built for Windows + macOS (arm64 & Intel) + Linux, VS Code extension
included in every zip, by GitHub Actions
(.github/workflows/release.yml).
2.12.1 — confirmed and documented rgb: true on read_image / load_image_dataset: pass it
to keep all three color channels (width * height * 3 numbers) instead of collapsing to
grayscale, for tasks where color itself is the signal.
2.12.0 — neural networks can now train on images, not just CSVs: read_image(path, width:, height:, rgb:) decodes a PNG/JPG/BMP/… into a flat 0..1 pixel vector, and
load_image_dataset(folder, width:, height:) turns a folder of labeled images (one subfolder per
class) straight into [examples, answers], one-hot encoded. See
examples/image_dataset.pt.
2.11.4 — world.remove(body_or_hitbox) takes something back out of the physics world (spawn
several enemies in a list, remove each when it dies). See examples/enemies.pt.
2.11.3 — the tilemap editor now merges the tile dictionary on save: only the characters
you changed are added/replaced, and hand-written entries (like a "#": gray color) are kept
instead of being purged.
2.11.2 — tile images actually draw now: draw_tilemap(level, tile_images: level_tiles)
renders a PNG per character (pass the editor's <map>_tiles dictionary). A text value is drawn
as an image, a color as a rectangle.
2.11.1 — the tilemap sidecar now carries its own import gamekit and always includes the
tile-image dictionary, so it checks/runs on its own and shows where to map characters to PNGs.
2.11 — the tilemap editor now keeps levels in their own file. Saving moves the map into a
sidecar <file>.tiles.pt and adds an import for it, so your main program stays short instead
of carrying dozens of rows inline.
2.10.3 — tilemap editor: assigning a PNG from outside the project folder now saves a clean
path (no stray //?/ Windows prefix), so the tile image loads.
2.10.2 — tilemap editor + / − buttons to add or remove columns and rows.
2.10.1 — tilemap editor pan (MMB / Space-drag / arrows) and wheel zoom.
2.10 — scrolling worlds and animation:
- Camera —
set_camera(x, y)/center_camera(x, y)scroll the world; every ordinary draw subtracts the offset.camera_bounds(0, 0, w, h)keeps the view inside the level, andcamera_x()/camera_y()read it back. - Sprite sheets —
load_sprite_sheet(path, cell_width:, cell_height:), thendraw_frame(sheet, frame, x, y)(withflip_x:ordraw_frame_scaled) andframe_countfor walk cycles and animations. - HUD drawing —
draw_text_screen/draw_rectangle_screenstay fixed on screen, unaffected by the camera. - Particles —
burst(x, y, color, count)(optionalspeed:/life:) fires self-managing sparks — no bookkeeping. - Smarter
build— every literalload_sprite/load_sprite_sheet/load_sound/load_music/load_fontpath is packed next to the app (keeping its relative path), so a built game runs anywhere.
2.9.1 — faster variable lookup/assignment in tight loops (FxHashMap scopes; assign without
re-allocating the key string).
2.9 — a bigger toolbox for apps and games:
- UI depth —
scrollareas,listanddropdownpickers, and multi-linetext_field, with Tab / Shift+Tab focus movement. - Audio depth — looping sound effects, streamed background music, and
volume / pitch / pan / fade (
load_music,play_music,fade_music,set_sound_*, …). - Tilemaps — character-grid levels (
tilemap,tile_at,draw_tilemap) that solid bodies collide with, plusplaintext edit_tilemap— a paint window that lays out a level and rewrites your.ptfile. - Save system —
save/load/has_savepersist any value (including your own class instances) to disk, written atomically.
Earlier in the 2.x line:
- 2.8 — Linux x64 and Intel-Mac release builds;
plaintext lsp(diagnostics, hover, go-to-definition, completions) and the VS Code extension that spawns it. - 2.4 — inline/anonymous functions (
make function (…) { … }) and the first form UI (text_field/checkbox/slider/imagewithbind:/on_change). - 2.x modules —
import gamekit(gravity, bodies, hitboxes),import web(web.get/get_json/post_json,to_json/parse_json), neuroevolution and CSV dataset loading forimport ai. - 2.0 — the neural-network / GPU /
plaintext buildbaseline.