engcode
v1.0.0
Published
Build with Simple English — a beginner-friendly programming language for scripts, websites, and desktop apps
Maintainers
Readme
EngCode
Build with Simple English
EngCode is a beginner-first programming language for scripts, websites, and desktop apps. One .eng file can describe what is on the screen, how it looks, and what it does — all in plain English.
set name to "Sam"
say "Hello, " plus nameNo semicolons. No braces. No type declarations. Blocks start with : and finish with end.
Status
Milestones 1–5 are complete. Terminal scripts, browser apps, and Electron desktop projects all run, and the developer tools are in place:
- variables,
say,ask, conditions, and loops - functions, closures, lists, tables, and
try - objects with
define a kind of thing called ... - modules with
use "helpers.eng" - files, device storage,
wait, and HTTPS requests - a persistent REPL
- six runnable terminal examples
- apps with pages, UI blocks, themes, styles, animations, media, events, timers, routing, storage, web data, and canvas
- six runnable app examples with DOM smoke tests, including a Windows 11-styled desktop notebook
- static websites with
engcode build web - a live-reload development server with
engcode serve - desktop projects with
engcode app,engcode build windows,engcode build mac, andengcode build linux - project scaffolds with
engcode new - a formatter with
engcode formatand a linter withengcode lint - an English step debugger:
--explainand--step - a 20-lesson tutorial with
engcode learn - a local playground with
engcode playground - a VS Code extension in
editor/vscode - install scripts and a release packager
- 302 automated tests, all passing
- 95.2% line, 87.8% branch, and 94.1% function coverage across the language, web compiler, desktop shell, browser runtime, and developer tools
- a one-million-iteration loop in well under two seconds
Desktop builds need Electron, which is installed on demand. The generated project includes the app, a locked-down Electron window, a launcher, and a npm run package script for a release folder. Code signing and notarization are separate publishing steps. The current release also needs Node.js 20 or newer; a Node-free standalone binary is not produced yet.
Install
EngCode needs Node.js 20 or newer — install it from nodejs.org if you do not have it. The package includes the compiler, CLI, runtime, tutorial, examples, docs, and playground, and works offline after installation.
Windows (PowerShell)
npm install -g engcode
engcode --versionIf PowerShell restricts npm scripts, call npm.cmd instead:
npm.cmd install -g engcodemacOS
npm install -g engcode
engcode --versionLinux
npm install -g engcode
engcode --versionIf npm reports EACCES (a permission error), run the command with sudo, or configure a prefix your own account owns:
npm config set prefix "$HOME/.npm-global"Add $HOME/.npm-global/bin to your PATH and run the install again.
From a checkout
npm install
npm run build
npm pack
npm install -g ./engcode-1.0.0.tgznpm pack builds the same tarball the registry serves, so tests, sources, and node_modules are not copied into the global install (npm install -g . would copy the whole folder).
Then check the install and start the tutorial:
engcode --version
engcode learnUpdate with npm install -g engcode@latest; remove with npm uninstall -g engcode. The install guide covers the local install scripts, release packaging, editor setup, and platform notes.
Run a file
With the global install, run any .eng file. From a checkout of this repository, the bundled examples are ready:
engcode run examples/hello/main.engOr start a fresh project anywhere:
engcode new my-project --type script
engcode run my-project/main.engFrom this folder, build once and then run any example without installing a command:
npm install
npm run build
node dist/src/cli.js run examples/hello/main.engOn Windows PowerShell, use npm.cmd if script execution is restricted:
npm.cmd run build
node dist/src/cli.js run examples/guess/main.engYou can pass input through the terminal, or pipe it in:
"Sam" | node dist/src/cli.js run examples/hello/main.engCheck a file without running it:
node dist/src/cli.js check examples/quiz/main.engOpen the interactive prompt:
node dist/src/cli.js replBuild a web app
An app puts pages, UI blocks, styles, and events in one .eng file:
app "Counter":
page "Home":
heading "Counter"
text "0" called "count"
button "Add one" called "add"
end
end
keep track of total as 0
style everything:
font is "Helvetica"
background is light gray
end
when "add" is clicked:
change total to total plus 1
change text of "count" to total
endThemes name your colours and fonts once, then styles reuse them. Dark values follow the visitor's system preference:
theme "Day":
accent is #2563eb
background is #f8fafc
text is #1f2937
font is modern
corner radius is 12
end
theme "Night" in dark mode:
background is #0f172a
text is #e2e8f0
end
style everything:
background is background
text color is text
font is font
end
style cards:
animation is slide up over 0.5 seconds
when mouse is over:
animation is float over 2 seconds forever
end
endImages, video, and audio take with description, width, height, poster, and loops:
image "sam.png" with description "A photo of Sam" and width 220 and height 220
video "tour.mp4" with description "A studio tour" and poster "cover.jpg" and loopsRun it with live reload while you edit:
node dist/src/cli.js serve examples/todoBuild a static website instead:
node dist/src/cli.js build web examples/todo --out siteThe output is plain HTML, CSS, JavaScript, and an assets/ folder. Open site/index.html in a browser or upload the folder to any static host. The build uses semantic HTML, a skip link, accessible form labels, a content security policy, and no eval.
engcode serve watches every .eng file in the project, rebuilds on save, reloads the browser, and shows compiler errors as an overlay. It picks the next free port when --port is busy.
Apps may read device storage with save ... to the device and load ... from the device. Web requests must use HTTPS. When engcode.json contains an allow list, the compiler embeds it and the browser runtime refuses other hosts:
{
"name": "weather",
"type": "app",
"entry": "main.eng",
"allow": { "network": ["api.open-meteo.com"] }
}Build a desktop app
Open an app in a native window:
engcode app examples/todoThe notes-desktop example is a complete Windows 11-style notebook. It uses Segoe UI Variable fonts, Fluent acrylic surfaces, light and dark themes, gentle fade and slide animations, search, pinning, and local storage:
engcode app examples/notes-desktopOr generate a desktop project for a platform:
engcode build windows examples/todo --out dist/windows
engcode build mac examples/notes --out dist/mac
engcode build linux examples/notes --out dist/linuxThe folder contains main.cjs, package.json, README.md, the website in app/, and a launcher (run.cmd or run.sh). Install Electron once and start it:
cd dist/windows
npm install
npm startnpm run package creates a release folder with Electron Packager. Build macOS releases on a Mac; code signing and notarization are additional publishing steps. The generated window uses context isolation, keeps Node.js out of the page, runs in a sandbox, serves files from a private 127.0.0.1 address, and sends external HTTPS links to the normal browser.
Developer tools
Start a new project:
engcode new my-project asks for script, website, or app
engcode new my-project --type appKeep source tidy and catch problems before running:
engcode format main.eng rewrite in the canonical style
engcode format examples/ format every .eng file
engcode format --check main.eng exit 1 if a change is needed
engcode lint main.eng report advice; --strict exits 1Watch a program run, statement by statement:
engcode run examples/guess/main.eng --explain
engcode run examples/guess/main.eng --stepLearn the language in 20 short lessons. Progress is saved in .engcode/learn.json:
engcode learn
engcode learn 7 --run
engcode learn 7 --file main.engOpen the local playground in a browser:
engcode playgroundThe playground runs scripts in a local server with a 200,000-statement limit and previews apps in a sandboxed iframe. It is a development tool, not a public sandbox.
The VS Code extension adds syntax highlighting, snippets, formatting, diagnostics, and run/serve commands. See editor/vscode/README.md.
Learn EngCode
- Getting started — a step-by-step guide from your first line to objects, modules, files, the REPL, and web apps.
- Design document — vision, keywords, semantics, architecture, CLI, sample programs, milestones.
- Formal grammar — EBNF for the whole language, including app and style blocks.
- Build apps and websites — pages, blocks, events, state, storage, and web data.
- Styling guide — colours, themes, fonts, motion, and responsive rules.
- Standard library — every built-in phrase.
- CLI reference — every command and option.
- Security and permissions — what a program can touch.
- Tutorial — the 20 lessons in readable form.
- FAQ — common questions and fixes.
- Cheat sheet — one page for quick reference.
- Install — installers, releases, and editor setup.
A first program:
set score to 0
repeat 3 times:
change score to score plus 1
end
say "Score: " plus scoreObjects:
define a kind of thing called Dog:
it has name and age
it can bark:
say name plus " says woof"
end
it can years with amount:
give back age plus amount
end
end
set rex to a new Dog with name "Rex", age 3
rex bark
say call rex's years with 10Examples
Every example is a complete, runnable program.
Terminal scripts:
| Example | What it shows |
| --- | --- |
| hello | say, ask, variables |
| guess | random numbers, while, conditions |
| calculator | functions, numbers, otherwise if |
| quiz | lists, tables, scores, for each |
| gauntlet | a longer 15-question language challenge, functions, scoring |
| rock-paper-scissors | random items, parentheses, or |
Web apps:
| Example | What it shows |
| --- | --- |
| todo | forms, lists, device storage, hover styles |
| portfolio | themes, light and dark mode, fonts, animations, images, video |
| weather | HTTPS data, tables, try, network allow list |
| notes | text areas, saved lists, page-open events |
| notes-desktop | Windows 11/Fluent styling, interactive note list, search, pinning, themes, animations |
| pong | canvas drawing, keyboard input, every frame |
Run terminal examples:
node dist/src/cli.js run examples/calculator/main.eng
node dist/src/cli.js run examples/quiz/main.eng
node dist/src/cli.js run examples/rock-paper-scissors/main.engOpen app examples:
node dist/src/cli.js serve examples/todo
node dist/src/cli.js serve examples/weatherOr build them all:
for example in todo portfolio weather notes notes-desktop pong; do
node dist/src/cli.js build web "examples/$example" --out "site/$example"
doneCommands
engcode new my-project scaffold a script, website, or app
engcode run file.eng run a terminal script
engcode run folder run the entry in engcode.json or main.eng
engcode serve folder run an app in the browser with live reload
engcode serve folder --port 3000 --open
engcode app folder open an app in a desktop window
engcode build web folder make a static website in dist/
engcode build web folder --out site --minify
engcode build windows folder make a Windows desktop project in dist/windows/
engcode build mac folder make a macOS desktop project in dist/mac/
engcode build linux folder make a Linux desktop project in dist/linux/
engcode check file.eng find mistakes without running
engcode check --json file.eng machine-readable diagnostics
engcode format file.eng rewrite a file in the canonical style
engcode lint file.eng report advice; --strict exits 1
engcode repl type English and run it right away
engcode learn the 20-lesson tutorial
engcode playground open the local playground
engcode help show help
engcode version show the versionAdd --explain or --step to run for the statement debugger. Add --allow-network to allow HTTPS requests in a terminal run. check prints accessibility notes as warnings and still exits successfully; --strict turns warnings into failures. Errors exit with code 1.
Project layout
src/ lexer, parser, checker, interpreter, web compiler, desktop shell, tools, CLI
runtime/ dependency-free browser runtime and DOM interpreter
examples/ runnable terminal programs and web apps
docs/ design, grammar, guides, reference, tutorial, FAQ
tests/ automated tests for every language feature and example
editor/ VS Code extension: grammar, snippets, diagnostics, commands
playground/ local playground page and assets
scripts/ install and release helpersLicence
MIT
