Documentation

Open-source core

The MathPets language, compiler, deterministic runtime, model-file validator, and VS Code extension are developed in public. The hosted Studio is a separate product built on that core.

Project boundary

A reusable toolchain, without the website

The public repository contains everything needed to parse, compile, validate, and run a MathPets model in another host. It does not include this website, account integrations, hosted APIs, or private product data.

That boundary keeps the core useful on its own: model files remain portable, compiler behavior is testable outside the Studio, and hosts can build their own interfaces around the same deterministic runtime.

Read the friendly language guide here, or browse the public source on GitHub.

dependency direction

source.petlanguage / compilermodel APIengine / runtimehost applications

Portable format

One model, four files

Executable rules live in source.pet. The three companions are ordinary YAML, so catalog copy, presentation, and parameter presets remain separate from simulation behavior. The validator checks the four files together and catches broken state, field, monitor, and parameter references before runtime.

my-model/  source.pet             executable model  definition.petmeta     title, description, topics, learning goal  styles.petstyle        colors, shapes, scales, transitions  presets.petpreset      named parameter configurations

Packages

What is in the core

Local workflow

Compile, validate, and package

The repository targets Node.js 20 or newer. One test command regenerates the parser, typechecks every package, builds the toolchain, and exercises compiler, editor, model-file, and runtime regressions.

Compiler output is standalone CommonJS. A host can load the resulting module, create the model, restart it, and advance deterministic ticks without importing the Studio.

core commands

npm installnpm test npm run compile:model -- examples/fire/source.pet \  --out /tmp/mathpets-fire.cjs npm run validate:model -- examples/firenpm run package:extension

Repository guides

Build with the core