Skip to content

humanapp/mindcraft-lang

Repository files navigation

Mindcraft Language

A tile-based programming language for creative coding applications.

Brain Rule

Mindcraft programs are built by arranging tiles -- typed, composable tokens -- into rules. Each rule has a WHEN side (condition) and a DO side (action). A collection of rules forms a brain that drives an autonomous actor. Host applications extend the language with custom types, sensors, and actuators.

The core library compiles to Roblox (Luau), Node.js, and browser (ESM) targets from a single TypeScript codebase.

The companion mindcraft-mcu repository extends Mindcraft to embedded hardware, starting with the BBC micro:bit: a native C++ implementation of the bytecode VM that runs brains on the device, plus a browser simulator and CODAL-inspired web device runtime for authoring and testing. A brain you build and test in the browser flashes to a real micro:bit over WebUSB and runs unchanged.

Mindcraft draws inspiration from other tile-based programming systems past and present, including Kodu Game Lab, Project Spark (Wiki), and MicroCode.

Demos

Packages

Package Description
@mindcraft-lang/core Mindcraft Language runtime -- tiles, parser, compiler, VM (multi-target: Roblox, Node.js, ESM)
@mindcraft-lang/app-host Project management, workspace storage, and IDB persistence for Mindcraft apps
@mindcraft-lang/ui Shared React UI -- shadcn/ui primitives + brain editor components
@mindcraft-lang/docs Shared documentation subsystem -- renders as in-app sidebar or full-screen SPA
@mindcraft-lang/ts-compiler TypeScript-to-Mindcraft bytecode compiler
@mindcraft-lang/bridge-protocol VS Code bridge network protocol types and schemas
@mindcraft-lang/bridge-client Client SDK for the VS Code bridge
@mindcraft-lang/bridge-app Opinionated layer atop bridge-client for the VS Code bridge

Apps

App Description
Ecosystem Sim Demo: carnivores, herbivores, and plants driven by user-editable Mindcraft brains
VS Code Extension Author Mindcraft sensors and actuators in TypeScript using VS Code Web (Marketplace)
VS Code Bridge Bridge server that relays between the VS Code extension and Mindcraft apps

Getting Started

Install the packages you need:

# Core only (language runtime, compiler, VM)
npm install @mindcraft-lang/core

# Core + UI (adds brain editor and shadcn/ui components)
npm install @mindcraft-lang/core @mindcraft-lang/ui

# Full stack (adds documentation sidebar and renderer)
npm install @mindcraft-lang/core @mindcraft-lang/ui @mindcraft-lang/docs

# For VS Code integration, see apps/ecosim for example implementation.

For full setup instructions -- Vite config, TypeScript paths, Tailwind, and component usage -- see the Integration Guide.

Documentation

Documentation is a work in progress. Browse the sim demo's language documentation online. See also the core package README for language architecture, the ui package README for the shared React components, and the docs package README for the documentation system.

Contributing

To report a bug or request a feature, please open an issue.

License

MIT

Releases

Contributors

Languages