Bundled samples¶
Example programs listed under Load Sample…. Generic Core samples live in samples/<name>/; samples exercising one specific language live next to that language in plugins/<plugin>/models/<name>/. 62 samples.
| Sample | Folder | Kind | Language | Description |
|---|---|---|---|---|
| Agreement (clause-structuring demo) | plugins/lang-agreement/models/agreement-demo |
Demo (lang-agreement) |
agreement |
A small language for structuring business-agreement clauses and their party obligations, generating readable contract text. |
| Changelog (Keep a Changelog) | plugins/lang-changelog/models/changelog-demo |
Demo (lang-changelog) |
changelog |
Write release notes as structured releases and categorized changes, with entries that reference model nodes by fully-qualified name, and generate Markdown. |
| core-typewalk | plugins/lang-core/models/core-typewalk |
Demo (lang-core) |
— | |
| DbScript (language-embedding demo) | plugins/lang-dbscript/models/dbscript-demo |
Demo (lang-dbscript) |
dbscript |
A Python-syntax host language whose RunQuery concept embeds a real select(...) node from the separate SQL mini-language plugin -- one language embedded live inside another, editable with its own structural editor. |
| Aurora C500 device profile | plugins/lang-devices/models/aurora-c500 |
Demo (lang-devices) |
devices |
A fictional office printer described in real units, with print jobs checked against its trays and duplex unit. |
| Secret Compartment (DSL Engineering book example) | plugins/lang-dslbook/models/dslbook-example |
Demo (lang-dslbook) |
dslbook |
A toy access-control DSL (after the DSL Engineering book's secretCompartmentLanguage): declare people and compartments with an owner and members, then check who can open what. |
| Entities (reference scope demo) | plugins/lang-entities/models/entities-demo |
Demo (lang-entities) |
entities |
Entity/property declarations with a scoped, concept-typed reference and a linkTarget check on a deprecated property. |
| Enum Types (compass directions) | plugins/lang-entities/models/enum-demo |
Demo (lang-entities) |
entities |
Demonstrates an enum-typed concept property: the Entities language declares a "Direction" enum (Up = 1, Down, Left, Right — auto-incrementing) and a Waypoint concept whose "heading" property is constrained to it. Focus a heading cell and press Alt+Enter for "Next value" to cycle through the enum's members. |
| Exercises (interactive lessons) | plugins/lang-exercises/models/exercises-demo |
Demo (lang-exercises) |
exercises |
An exercise book whose tasks check the learner's own code in the Tests pane: write your solution in the workbench root, then run the tests. |
| Fixed-Width Reader (record schema + parser demo) | plugins/lang-fixedreader/models/fixed-length-reader |
Demo (lang-fixedreader) |
fixedreader |
A toy fixedLengthReader-style language: declare a fixed-width record schema, then parse sample lines against it. |
| Math Notation (2D formula demo) | plugins/lang-formula/models/formula-demo |
Demo (lang-formula) |
formula |
A small mathematical-notation language rendered with genuine 2D layout — fractions, powers, roots, sums, integrals, limits, derivatives, matrices, and set/quantifier notation. |
| Generator plan showcase | plugins/lang-genplan/models/generator-plan-demo |
Demo (lang-genplan) |
core.py.genplan |
Run "Run Generator" to see this language's Generator Plan produce two outputs from one model — the program unchanged, and a documentation view extracted from its comments. |
| Heating (thermostat decision table demo) | plugins/lang-heating/models/heating-demo |
Demo (lang-heating) |
heating |
A toy samples/heating-style language: a Heating system's thermostat control rules rendered as a decision table (min/max/action), then checked against sample readings. |
| Hover Tooltips (opt-in <Tooltip>/<Tip> demo) | plugins/lang-heating/models/tooltips-demo |
Demo (lang-heating) |
heating |
A named heating system on the Heating language, chosen because it has zero tooltips out of the box: three of its concepts (heating/thermostat/check temp) are wrapped in editor-jsx.ts's <Tooltip>/<Tip> with custom hover text, while its comment and decision-table row are deliberately left unwrapped. |
| JavaScript tour | plugins/lang-js/models/js-tour |
Demo (lang-js) |
jsgrammar |
Real JavaScript where every construct is a structure you can edit: switch, labeled loops, optional chaining, destructuring, generators, classes with fields, accessors and static blocks. Press Run to see the output. |
| JS Grammar Demo | plugins/lang-jsgrammar/models/jsgrammar-demo |
Demo (lang-jsgrammar) |
jsgrammar |
This model is written in real JavaScript syntax instead of Python — a .model.js file, parsed and printed by the JavaScript grammar rather than the default Python one. |
| JSON | plugins/lang-json/models/json-demo |
Demo (lang-json) |
json |
A JSON document as a model: persisted as plain JSON text (.model.json), evaluates to its native value. |
| KernelF tests | plugins/lang-kernelf-test/models/kernelf-tests |
Demo (lang-kernelf-test) |
kernelf-test |
Test suites and assertions for KernelF models, run from the Tests pane. |
| KernelF (functional expression language) | plugins/lang-kernelf/models/kernelf-demo |
Demo (lang-kernelf) |
kernelf |
A functional, statically typed expression language: exact decimals with range types, options, functions and lambdas. |
| Lambda Calculus (beta reduction demo) | plugins/lang-lambda/models/lambda-demo |
Demo (lang-lambda) |
lambda |
A minimal untyped lambda calculus — variables, functions, and applications — with real beta reduction, showing how far a tiny handful of concepts can go. |
| LibCall (cross-model byId reference demo) | plugins/lang-libcall/models/libcall-demo |
Demo (lang-libcall) |
libcall |
A function declaration and a call to it, linked by a stable internal reference rather than by name — so renaming the function doesn't break the call. |
| Markup Authoring (structured document demo) | plugins/lang-markup/models/markup-demo |
Demo (lang-markup) |
markup |
A small XML-like markup-authoring language — elements, attributes, and text nodes — that generates readable markup text. |
| Money (currency-typed arithmetic demo) | plugins/lang-money/models/money-demo |
Demo (lang-money) |
money |
Currency-aware arithmetic — adding amounts in the same currency succeeds; mismatched currencies are flagged instead of silently summed. |
| Name Clash (same-named references) | plugins/lang-nameclash/models/nameclash-demo |
Demo (lang-nameclash) |
nameclash |
A variable, a function and a define all called expr — in one root and in another — and how a reference says which one it means. |
| Notation switching demo | plugins/lang-notations/models/notation-switching-demo |
Demo (lang-notations) |
notations |
A StateMachine model with three notations of the same data — plain text, a table, and a diagram. Click the ⊞ badge next to the state machine to cycle between them. |
| Quotation demo | plugins/lang-quotation/models/quotation-demo |
Demo (lang-quotation) |
quotation |
Embeds real Core expressions (Power, Plus) as quoted values via the Quotation concept — toggle the notation badge to see the read-only constructor-form preview. |
| Maze Explorer (grid-world scripting demo) | plugins/lang-robot/models/maze-explorer |
Demo (lang-robot) |
robot |
A toy grid-world robot-scripting language: move/turn/pick up/drop items and sense walls ahead on a bounded grid whose internal walls are generated fresh from the script's own name/size. |
| S-Expression Demo | plugins/lang-sexpr/models/sexpr-demo |
Demo (lang-sexpr) |
sexpr |
A small S-expression (Lisp-style parenthesized) language, persisted with its own hand-written parser instead of the usual tree-sitter grammar. |
| Shapes (language-extension demo, step 1) | plugins/lang-shapes/models/shapes-demo |
Demo (lang-shapes) |
shapes |
A tiny language that extends Core with one new concept, Circle. First link of an extension chain — see the Shapes3D plugin, which extends this language in turn. |
| Shapes3D (language-extension demo, step 2) | plugins/lang-shapes3d/models/shapes3d-demo |
Demo (lang-shapes3d) |
shapes3d |
Extends the Shapes language (itself an extension of Core) by adding a Sphere shape built from a Circle — a two-step chain of language extension. |
| The Simplest Language (minimal concept demo) | plugins/lang-simplest/models/simplest-demo |
Demo (lang-simplest) |
simplest |
The smallest possible language definition — one concept, one string property, one editor rule, one generator rule. |
| JS Interop Demo | plugins/lang-stdlib/models/interop-demo |
Demo (lang-stdlib) |
jsgrammar |
Calls real JavaScript globals (Math.*) by dotted path from a JavaScript-grammar model, using the stdlib "JS Interop" language's js(path, ...args) escape hatch. |
| Test Language (editor-interaction demo) | plugins/lang-testlang/models/keypress-demo |
Demo (lang-testlang) |
testlang |
Demonstrates AssertKeypress: asserting what simulating a keypress does to the live projectional editor, in addition to testlang's existing checks/type/generator/eval assertions. Open "Tests" and press "Run All Tests" to run it. |
| TypeScript Grammar Demo | plugins/lang-typescript/models/typescript-demo |
Demo (lang-typescript) |
typescript |
This model is written in real TypeScript syntax — typed variables, parameters, and return types — with those type annotations understood by the editor's own type checker. |
| UI Kit demo | plugins/lang-uikit/models/uikit-demo |
Demo (lang-uikit) |
uikit |
A live-editable roster table alongside a showcase of every interactive UI widget available to a concept's editor — switches, sliders, date pickers, dialogs, and more — each rendered directly on the canvas, not just in a form. |
| VibroSelect (vibro/impact hammer selector demo) | plugins/lang-vibro/models/vibro-demo |
Demo (lang-vibro) |
vibro |
A toy re-imagining of IQIP's VibroSelect tool: declare a pile, soil profile, target depth, and equipment catalog, then rank vibro+impact hammer combinations by envelope margin. Export a branded selection report as a self-contained HTML preview. |
| XML | plugins/lang-xml/models/xml-demo |
Demo (lang-xml) |
xml |
An XML document as a model: persisted as plain XML text (.model.xml). |
| CI/CD pipeline (big diagram) | samples/ci-pipeline-diagram |
Generic | core.py.diagram |
A 15-step build/test/deploy pipeline with real branches and merges (three parallel OS builds, a security-scan side branch, a staging/rollback fork) — big enough to exceed the auto-fit box and switch into pan/zoom mode, exercising the minimap, the reset-to-fit button, the Mod+K command palette, Manhattan edge routing across several crossing paths at once, and a FlowGroup (the OS builds) that folds into one box via Collapse All Groups. |
| Console Cookbook | samples/console-cookbook |
Generic | core.py |
A small program with functions, loops, and conditionals to explore with the Model Console. |
| Structure checks from the console | samples/console-structure-checks |
Generic | core.py |
Use the Model Console to hash a program, read it as JSON, and assert its structure with patterns that name the first mismatch. |
| Concept CSS styling showcase | samples/css-styling-demo |
Generic | core.py |
Every concept can carry its own scoped CSS, edited live in the Language pane — restyle a keyword, the node itself, or theme-match a color, and every place that concept appears updates immediately. |
| Decision table | samples/decision-table |
Generic | core.py |
First-match decision tables across four programs: a letter-grade lookup, tax brackets, shipping tiers, and HTTP status classification. |
| Build pipeline dashboard | samples/dependency-graph |
Generic | core.py.diagram |
A build pipeline as an EditableFlowDiagram — each step's label is a real, live editor cell embedded right on the diagram box, edit it in place instead of through a side panel — paired with a DecisionTable (also live-editable cells) that picks a remediation action for whichever stage failed. Drag a box's handle strip to reposition it; the position is saved with the file. |
| Flow diagram | samples/flow-diagram |
Generic | core.py.diagram |
Visualize algorithm steps as a flowchart — a FlowDiagram renders labeled boxes connected by arrows. |
| Code generator showcase | samples/generator-demo |
Generic | core.py |
Open the Generator pane to see this struktJS program translated to Python code in real time. |
| Generators tour | samples/generators-tour |
Generic | invoicing |
One small invoice language, every kind of generator rule: text, indented text, function, files, named exports, rule imports, and a plan. |
| Guess the number | samples/guess-the-number |
Generic | core.py |
Pick a random secret, ask the user to guess via Input, and count how many guesses it took. |
| Hello world | samples/hello |
Generic | core.py |
Output a literal greeting. |
| JS tests | samples/js-tests |
Generic | core.py |
A small program and a test root written in JavaScript that calls the workbench API: it runs checks and the program, edits a copy of the model in a transaction, and expects the results. Open the Tests pane and press Run All Tests. |
| Mixed-language roots | samples/mixed-language-roots |
Generic | core.py |
One model whose roots are written in different languages: a Core program stored as Python text and a JS Grammar program stored as JavaScript text. |
| Model-to-model: lowering a sum to add() | samples/model-to-model |
Generic | lowering |
A project language with a model-to-model rule: Run Generator lowers every sum to a call of add(). Edit the rule under Language settings > Transformations. |
| Multi-root model | samples/multi-root-demo |
Generic | core.py |
One model, two root programs sharing the same data — switch between them in the Explorer under this model's own folder. |
| Pattern matching | samples/pattern-matching-demo |
Generic | core.py |
Structural match/case: literal and or-patterns, a capture binding, and a wildcard fallback. |
| Python language tour | samples/python-tour |
Generic | core.py |
One model, six roots: checking rules, constraints, data-flow analysis, the type system, the debugger and the Messages panel — each its own root of the same Core model. |
| Release notes workshop | samples/release-notes-workshop |
Generic | changelog |
A hands-on tour of the newer editing features: spell check, model listeners, selection-aware intentions, saved versions and Explorer views, all on a small changelog. |
| Rich Doc Comments | samples/rich-doc-comments |
Generic | core.py |
Doc comments with real inline formatting — bold, italic, code, links — authored as markdown and rendered live in the editor. |
| Ruff linter showcase | samples/ruff-lint-demo |
Generic | core.py |
A deliberately messy program that trips as many enabled Ruff linters as possible — each block demonstrates a different rule. |
| Module imports | samples/stub-loading |
Generic | core.py |
Import any stdlib module and use its members — completions come from bundled typeshed stubs (1200+ modules). Type "import " and press Ctrl-Space to browse; type "math." and press Ctrl-Space to see members. |
| Tax calculation (VAT on an invoice) | samples/tax-calculation |
Generic | kernelf-test |
VAT on an invoice to the cent: money with a rounding policy, a rate table, per-line versus per-rate VAT, tests, and "explain this result". |
| Guided tour | samples/tour |
Generic | core.py |
A tiny shopping-total program for the first-run tour: break it, see the check, run it, generate Python. |
| Tricky syntax | samples/tricky-syntax |
Generic | core.py |
Editor stress-test — decorators, async/await, generator expressions, typed params, return-type annotations, nested f-strings, walrus, raw/multiline strings, metaclasses, and deeply nested literals. Not runnable (imports & metaclasses); built to project and round-trip. |
| Workbench Scripts | samples/workbench-scripts |
Generic | core.py |
A small program with three project scripts that call the workbench API: a report, a transactional edit with arguments, and an open trigger. Run them with the command line (see the README). |