Fantasy Console

A console, its language and its studio — in one HTML file.

FABLE-8: a 128×128, 16-colour fantasy console with its own language, its own studio and its own chip-tune engine — in one HTML file with no build step and no dependencies.

1
file, zero dependencies
128×128
at 16 colours
4
playable carts included

A language, a VM, and a studio in 560 KB

FableScript is a real language with a hand-written lexer, parser and tree-walking interpreter — not a config format with loops bolted on. Around it sits the virtual machine, a Web Audio chip-tune engine, a JSON cartridge format, and a full development studio with code, sprite, map, SFX and music editors. Gamepads, touch controls and AZERTY/QWERTZ/Dvorak keyboards are all handled. Download index.html, double-click it, and the whole console works offline over file://.

Decisions

Writing the interpreter rather than embedding one

Using JavaScript as the cart language would have been a weekend instead of a project. A hand-written lexer, parser and evaluator means the console controls its own semantics, its own error messages, and its own sandbox — and it is the part of this that is genuinely an exercise in language implementation rather than in gluing libraries together.

One file, on purpose

No bundler, no server, no package manager. The constraint forces every feature to justify its bytes and makes the artefact permanent: it will still open in fifteen years, which is not true of anything with a node_modules directory.

A tutorial written in the language it teaches

LEARN FABLESCRIPT is an eight-page interactive tutorial cart, written in FableScript. Finish it, press Esc, and you are reading its own source. Documentation that cannot go out of date because it is a running program.

Constraints are a design tool, not a limitation

128×128 and sixteen colours are not a technical ceiling — modern browsers would happily do more. They are the thing that makes a cart finishable. The same is true of the single-file rule: most of what makes this console pleasant to use exists because something else was not allowed in.

Built with

  • Vanilla JS
  • Custom language
  • Lexer · Parser · Interpreter
  • Web Audio
  • Canvas