{"slug": "show-hn-i-rewrite-my-game-while-it-is-still-running", "title": "Show HN: I rewrite my game while it is still running", "summary": "JdBasic, a modern BASIC interpreter built around a custom bytecode virtual machine, now runs as an MCP server, enabling AI pair coding with Claude to live-patch a running game without restarting. In a 73-second video, pressing F6 pauses the VM, and commands like 'Turn the ship red and give me 100 lives' are executed via jdb_eval, while source edits trigger jdb_recompile to recompile and resume at the correct opcode. The tool, created by AtomiJD, supports hot-reloadable code, APL-style array programming, and integrations with Godot, local LLMs, and ONNX models.", "body_md": "jdBasic can run as an MCP server. The video shows AI pair coding with Claude: while my mini shooter is running I press F6, the VM pauses, and whatever I ask Claude to change goes through the jdBasic MCP server straight into the running interpreter.\n\n- \"Turn the ship red and give me 100 lives\" - Claude changes two variables with `jdb_eval` :`g_palette{\"player\"} = [255, 80, 80] : lives = 100`\n- \"Move the shield bar 20 pixels up\" - that needs a source edit and a recompile. `jdb_recompile` compiles the code and puts the program pointer back on the right opcode. Claude resumes, everything is still at the same position with the same values, only the rendering loop now draws with the changed SUB.\n\nI built jdBasic because I missed the easiness of VB6: pause a running program, edit the code and the form, carry on. jdBasic was always meant to be a dirty little language that still does this. Using AI to code needed an MCP server inside jdBasic. Inside the game it is one small IMPORT for the MCP handling and one line in the rendering loop.\n\n**[Video, 73 seconds](https://youtu.be/s-BRaSy1EQo)** · **[My blog post](https://www.atomijd.onl/blog-post-19.html)** · **[MCP setup and tool reference](https://jdbasic.org/ai-pair-coding/)** · [Windows zip with the shooter, nothing to install](https://github.com/AtomiJD/jdBasic/releases/latest)\n\n**jdBasic** is a modern BASIC interpreter built around a custom **bytecode virtual machine** with APL-style array programming, hot-reloadable code, a persistent REPL workspace, and first-class graphics, GUI, audio, networking, AI, and **Godot-engine** integration.\n\nIt combines the immediacy of classic BASIC with powerful built-in capabilities and a \"stay in the session\" philosophy - no constant restarts, no rebuild loops, just **think and run**.\n\n**Reduce friction between thinking and running code.**\n\n*A match-3 game, a Godot RPG whose NPCs think with a local LLM, and the VS Code form designer - all scripted in jdBasic.*\n\n**🎥 Train jdBasic** is on YouTube - 14 video lessons covering everything from PRINT to native compilation, all auto-generated and voiced by jdBasic itself. [Watch the playlist →](https://www.youtube.com/playlist?list=PLowaSH4O3MGq-veO7qSIp-9EntEjY_iPZ)\n\nYou can:\n\n- explore ideas in a powerful interactive REPL\n- save and restore entire sessions with `SAVEWS` /`LOADWS`\n- write vectorized data pipelines using APL-inspired array operators\n- prototype graphics, games, and tools with SDL3 + Dear ImGui\n- embed in **Godot 4** and script whole 3D games, tools, and visualizers in pure BASIC\n- talk to local LLMs (llama.cpp) and run ONNX models inline\n- pair-program with an AI agent: the built-in **MCP server** exposes a persistent VM that Claude Code, Cursor & Co. can run, inspect, and live-patch without restarting your program\n- build automation tools, REST clients, and serial-device controllers\n- extend the language with native modules\n\n[jdbasic.org/live](https://jdbasic.org/live/index.html) - no installation required.\n\nThe **Train jdBasic** YouTube series walks through the language from\n\"Hello, World\" to native compilation - 14 episodes, 5–10 minutes each,\nwith auto-generated chapters and code-on-screen as it happens.\n\n| # | Lesson | Topic | \n|---|---|---|\n| 01 | [Hello jdBasic](https://youtu.be/4qvPFoqxPHE) | PRINT, DIM, basic types | \n| 02 | [If and For](https://youtu.be/RTI-f9cHldI) | IF/ELSE, FOR/NEXT, FizzBuzz | \n| 03 | [Arrays](https://youtu.be/V33CGCt1zB8) | Vector ops, broadcasting, reductions | \n| 04 | [Strings](https://youtu.be/NUhdrMU9T9c) | Slice, search, SPLIT | \n| 05 | [Functions and SUBs](https://youtu.be/_4Q7qR1sA3Q) | FUNC, SUB, recursion | \n| 06 | [Maps](https://youtu.be/vp0tCYa6__A) | Key-value data | \n| 07 | [INPUT and DO Loops](https://youtu.be/1Sd7jCzY8Zc) | User-driven programs | \n| 08 | [File I/O](https://youtu.be/gbFvgqIYNMM) | TXTWRITER, TXTREADER$ | \n| 09 | [Graphics](https://youtu.be/qtBCNaVaRLA) | SCREEN, shapes, colours | \n| 10 | [Modules](https://youtu.be/fg0ib3SgGio) | EXPORT, IMPORT, code reuse | \n| 11 | [REPL Workflow](https://youtu.be/Noa4mqwEZ5w) | PRETTY, LINT, SAVEWS | \n| 12 | [Higher-Order Functions](https://youtu.be/WPpzO0tHJNE) | SELECT, FILTER, REDUCE, lambdas | \n| 13 | [HTTP and JSON](https://youtu.be/ecq8uZHAV7U) | Talk to the web | \n| 14 | [Native Compilation](https://youtu.be/4DlthnUo56w) | Compile to .exe with `jdbasic -c` | \n\nThe entire production pipeline - voice synthesis, screen recording,\nFFmpeg compositing, even the YouTube uploads - is itself a jdBasic\nprogram. See [`jdb/tv/`](/AtomiJD/jdBasic/blob/main/jdb/tv) if you want to fork the rig.\n\nThis is the **v2 rewrite**. Compared to the original tree-walking interpreter, jdBasic now ships with:\n\n- A **bytecode compiler + virtual machine** with inline caches, opcode fusion, and a fast intrusive‑refcount value type\n- **APL-style vectorization** -`SIN` ,`COS` ,`+` ,`*` , scatter/gather,`IOTA` ,`REDUCE` ,`SCAN` ,`FILTER` ,`SELECT` all operate over arrays in a single op\n- **Eigen-backed linear algebra & DSP** -`SVD` ,`QR` ,`DET` ,`EIG` , and`FFT` /`IFFT` as first-class array builtins\n- **SDL3** graphics with letterboxed logical presentation,`TOGGLE_FULLSCREEN` , and a streaming-texture batch plotter (`GFX.PLOT_POINTS_TEX` ) that can push 70k coloured pixels per frame at 30+ FPS from pure BASIC\n- **Dear ImGui** integration for instant-mode tools and debuggers\n- **Godot 4 embed (GDExtension)** - run jdBasic*inside* Godot:`.jdb` files become engine scripts and the`GDX.*` suite reaches the whole engine (nodes, physics, 3D meshes, audio, signals), with an in-editor debugger and Inspector-exposed variables - see[`embed/godot/`](/AtomiJD/jdBasic/blob/main/embed/godot)\n- **Music sequencer** - a tracker-style`SOUND.*` engine (patterns, voices, effects) with a device-less`SOUND_DSP` pull mode for embedding - see[`doc/SequencerHelp.md`](/AtomiJD/jdBasic/blob/main/doc/SequencerHelp.md)\n- **llama.cpp** for local LLM inference (CPU + optional CUDA)\n- **ONNX Runtime** for classical ML inference\n- **HTTP/HTTPS** client (OpenSSL),**COM** automation (Windows),**Serial** I/O for embedded\n- **Reactive variables** (`->` operator) with automatic dependency propagation\n- **Hot reload** of source files without losing the workspace\n- **DAP debug adapter** so you can step through BASIC code from VS Code\n- A **persistent REPL workspace** that survives restarts via`SAVEWS` /`LOADWS`\n- **Microcontroller ports** - the same interpreter on an RP2350 or an ESP32-S3, with a REPL and a flash store on the board; on the 2.8 inch ES3C28P it boots into its own prompt on the panel, with touch, sound, a microphone and a card slot - see[`embedded/`](/AtomiJD/jdBasic/blob/main/embedded)\n- An **MCP server** (`jdbasic --mcp` ) that exposes the persistent VM to LLM agents like Claude Code, Cursor, or Cline - see[`doc/MCP.md`](/AtomiJD/jdBasic/blob/main/doc/MCP.md)\n\nThe original v1 codebase is preserved on the [`legacy-v1`](https://github.com/AtomiJD/jdBasic/tree/legacy-v1) branch and the [`v1-legacy`](https://github.com/AtomiJD/jdBasic/tree/v1-legacy) tag for archival and bugfixes.\n\n```\nDIM BaseValue AS INTEGER = 10\nDIM Multiplier AS INTEGER = 5\n\nDIM Result AS REACT INTEGER\nResult -> BaseValue * Multiplier\n\nPRINT Result    ' 50\n\nMultiplier = 10\nPRINT Result    ' 100  - updated automatically\n' Generate 10 numbers, keep > 5, multiply by 10\nresult = IOTA(10) |> FILTER(LAMBDA x -> x > 5, ?) |> SELECT(LAMBDA v -> v * 10, ?)\nPRINT result    ' [60 70 80 90 100]\n' All trig is vectorized - one call processes the whole array\nDIM angles = IOTA(360) * (PI / 180)\nDIM sines  = SIN(angles)\nDIM cosines = COS(angles)\nSCREEN 800, 600, \"My Tool\"\nDIM BgColor[4] = [0.2, 0.3, 0.3, 1.0]\n\nDO\n    CLS\n    IF GUI.BEGIN(\"Control Panel\", 50, 50, 300, 200) THEN\n        GUI.TEXT \"Welcome to jdBasic GUI\"\n        GUI.SEPARATOR()\n        IF GUI.BUTTON(\"Click Me\") THEN\n            PRINT \"Clicked at \" + TIME$\n        ENDIF\n        GUI.COLOR(\"Background\", BgColor)\n    ENDIF\n    GUI.END()\n    SCREENFLIP\n    SLEEP 16\nLOOP UNTIL INKEY$() = \"q\"\n```\n\nOn Windows, the `FORMS` build flag adds a full retained-mode toolbox of **real Win32 controls**: buttons, text boxes, list/tree/list-view, tabs, sliders, date pickers, menus with accelerators, toolbars, status bars, MDI child windows and the classic common dialogs. Events bind by name convention, a one-parameter `SUB <control>_<event>` is wired automatically, no registration needed:\n\n```\nfrm = FORM.CREATE(\"Hello\", 320, 200, \"MAIN\")\nbtn = FORM.BUTTON(frm, \"btnGo\", \"&Go\", 110, 80, 100, 28)\n\nSUB BTNGO_CLICK(e)\n    MSGBOX(\"It really is that simple.\", 64, \"Hello\")\nENDSUB\n\nFORM.RUN(frm)\n```\n\nLayouts can live in declarative **`.jdform`** JSON files (` FORM.LOAD` instantiates and binds them), and the VS Code extension ships a **visual form designer** with drag/resize, property grid and double-click-to-handler. Coordinates are DPI-independent logical units, and the same source compiles to a standalone `.exe` with `jdbasic -c`. See `jdb/demos/forms/gallery.jdb` (every control on three tab pages) and `jdb/demos/forms/mdi_demo.jdb`.\n\nThe [`jdb/demos/graphics/universe.jdb`](/AtomiJD/jdBasic/blob/main/jdb/demos/graphics/universe.jdb) demo plots **70 000 coloured pixels per frame at 30+ FPS** from pure BASIC, by combining vectorized inner loops with a single GPU upload via `GFX.PLOT_POINTS_TEX`.\n\n```\n./build/jdBasic.exe jdb/demos/graphics/universe.jdb\n```\n\nVectorized arithmetic + bitops let you push real workloads - physics, cellular automata, SAT, DSP - through whole-array operations instead of per-cell loops. See **[doc/APL_pipeline.md](/AtomiJD/jdBasic/blob/main/doc/APL_pipeline.md)** for a tutorial walking from \"tight FOR loops\" to \"one line per update step\" using the demos under `jdb/bench/` and `jdb/`. Highlights:\n\n- `jdb/demos/apl/life_demo.jdb` - live Conway 200 × 150 at 60 FPS via an ONNX 3×3-conv backend\n- `jdb/demos/graphics/boids_apl.jdb` - 5 000 particles at ~630 FPS, all-vector update\n- `jdb/demos/sound/synth_apl.jdb` - additive synthesis, 4 096 samples/frame in five vector ops\n- `jdb/bench/life_bench.jdb` /`jdb/bench/mandelbrot_bench.jdb` - when APL form wins (Conway, 4–13×) and when it loses (Mandelbrot, ~4×)\n\nNumbers from the latest run: **[jdb/bench/Results.md](/AtomiJD/jdBasic/blob/main/jdb/bench/Results.md)**.\n\njdBasic embeds in **Godot 4** as a GDExtension: a `.jdb` file *is* a Godot script. The `GDX.*` native suite reaches the engine directly - nodes, the physics server, 3D meshes and materials, audio buses, and signals - so you can build whole scenes without a line of GDScript and step through them in the in-editor debugger.\n\n```\nEXTENDS Node3D            ' this .jdb file IS the Godot script\n\nDIM cube_h = 0\n\nSUB _ready()\n    cube_h = GDX.CALL(GDX.SELF(), \"get_node\", \"Cube\")\nENDSUB\n\nSUB _process(delta)\n    ' spin the cube; rotation:y indexes into the Vector3 property\n    GDX.SET(cube_h, \"rotation:y\", GDX.GET(cube_h, \"rotation:y\") + delta)\nENDSUB\n```\n\nFour projects under [`godot/`](/AtomiJD/jdBasic/blob/main/godot) show how far it goes - all logic in jdBasic, running on Windows and Linux (NVIDIA/CUDA and AMD/Vulkan):\n\n- **`rpg-native`** - a 3D action-RPG: procedural heightmap terrain, a data-driven dungeon, day/night, an item shop, and**NPCs whose entire dialogue brain is a local LLM** (llama.cpp) with RAG over the world lore - quests, memory, and tool-calling, all in jdBasic.\n- **`audioviz`** - a live**microphone → FFT → 3D spectrum waterfall** , built on the new`FFT` builtin with an orbiting camera.\n- **`livecoder`** - the` SOUND.*` sequencer hosted in Godot with a mixer UI and TR-808 samples, for live-coding music.\n- **`jd-one`** - a sandbox of small scenes (Breakout, a spinning cube, a reactive audio tunnel, GDScript-vs-jdBasic benchmarks).\n\nSee [`embed/godot/README.md`](/AtomiJD/jdBasic/blob/main/embed/godot/README.md) for the embed architecture and the `GDX.*` reference.\n\n**Status: experimental.** The embed is developed on the `godot_spinoff` branch and there are no prebuilt extension binaries yet - you build the GDExtension yourself (SCons recipe included). The projects above run, but expect sharp edges.\n\nThe [`jdb/` sample gallery](/AtomiJD/jdBasic/blob/main/jdb/README.md) holds 250+ ready-to-run programs, organised by domain: complete games (a chess engine, a raytracer, Tetris, TILT, PRISMA), a **6502 CPU + Apple II emulator**, a music sequencer with FX racks, web apps with sessions and templates, TUI dashboards, AI/RAG demos, and the APL teaching set.\n\n*TILT - an Apple II emulated in 30 KB of jdBasic - the live music sequencer with its ImGui scope.*\n\n- **Online** :[jdbasic.org/live](https://jdbasic.org/live/index.html)\n- **Windows binaries** : see[Releases](https://github.com/AtomiJD/jdBasic/releases) - what changed is in[RELEASE_NOTES.md](/AtomiJD/jdBasic/blob/main/RELEASE_NOTES.md)\n\n**First run on Windows.** The binaries are code-signed, but because the\ncertificate is new, Microsoft Defender SmartScreen may show a *\"Windows\nprotected your PC - unrecognised app\"* prompt the first time you run\n`jdBasic.exe`. It is a reputation notice, **not** a malware detection - the\nsigned publisher is shown in the dialog. Click \"More info\" then \"Run anyway\".\nTo skip it, right-click the downloaded `.zip` -> Properties -> tick\n**Unblock** before extracting.\n\nDownload a bundle from [Releases](https://github.com/AtomiJD/jdBasic/releases/latest) (the **VB6 pack** is a good all-round choice - it ships demos), unzip, then:\n\n```\njdBasic.exe                     starts the REPL\n? PRINT \"Hello, jdBasic!\"\nHello, jdBasic!\n? PRINT SUM(IOTA(100))          ' array programming: 1+2+...+100\n5050\n? HELP \"SORT\"                   ' built-in reference for every command\n```\n\nRun a program from a file:\n\n```\njdBasic.exe demos\\gallery.jdb   native Win32 forms, every control\njdBasic.exe demos\\tasklist.jdb  a small app built with the visual designer\n```\n\nCloned the repo and built from source instead? Try the pixel-storm:\n\n```\n./build/jdBasic.exe jdb/demos/graphics/universe.jdb\n```\n\n- See **[doc/BUILD.md](/AtomiJD/jdBasic/blob/main/doc/BUILD.md)** for the full build guide (prerequisites, third-party libraries, feature flags, packaging)\n\n- **Video tutorials** :[Train jdBasic playlist on YouTube](https://www.youtube.com/playlist?list=PLowaSH4O3MGq-veO7qSIp-9EntEjY_iPZ) - 14 episodes, beginner to native compile\n- **Examples** : the[sample gallery](/AtomiJD/jdBasic/blob/main/jdb/README.md) - 250+ programs under[`jdb/`](/AtomiJD/jdBasic/blob/main/jdb)\n\n| Doc | What it covers | \n|---|---|\n| [doc/languages.md](/AtomiJD/jdBasic/blob/main/doc/languages.md) | The full language reference - every statement, function and build-flag-gated API | \n| [help.txt](/AtomiJD/jdBasic/blob/main/help.txt) | Per-command reference, also served by `HELP \"topic\"` in the REPL | \n| [doc/BUILD.md](/AtomiJD/jdBasic/blob/main/doc/BUILD.md) | Building from source: prerequisites, feature flags, packaging (Windows/Linux/macOS) | \n| [doc/MCP.md](/AtomiJD/jdBasic/blob/main/doc/MCP.md) | The MCP server: client configs for Claude Code, Cursor, Cline & Co., tool reference | \n| [doc/WebDev.md](/AtomiJD/jdBasic/blob/main/doc/WebDev.md) | Web apps with `HTTP.SERVER` , templates, sessions and SQLite - the JDWEB framework | \n| [doc/SequencerHelp.md](/AtomiJD/jdBasic/blob/main/doc/SequencerHelp.md) | The `SOUND.*` live-coding sequencer and synth | \n| [doc/AudioFX.md](/AtomiJD/jdBasic/blob/main/doc/AudioFX.md) /[doc/HowTo-FX.md](/AtomiJD/jdBasic/blob/main/doc/HowTo-FX.md) | The FX chain: guitar/synth effects, FFT analysis, the ImGui pedalboard | \n| [doc/APL_pipeline.md](/AtomiJD/jdBasic/blob/main/doc/APL_pipeline.md) | Tutorial: from tight FOR loops to whole-array update steps | \n| [doc/howto-vector-matrix-data.md](/AtomiJD/jdBasic/blob/main/doc/howto-vector-matrix-data.md) | Data-wrangling cookbook: build, transform, group, reshape | \n| [doc/idioms-from-python.md](/AtomiJD/jdBasic/blob/main/doc/idioms-from-python.md) | Python-to-jdBasic cheat sheet (also great context for AI agents) | \n| [doc/CODING_STYLE.md](/AtomiJD/jdBasic/blob/main/doc/CODING_STYLE.md) | Conventions for contributing to the C++ core | \n\n- **VS Code extension** : syntax highlighting and DAP debugger support - see[vscode_extension/vscode_readme.md](/AtomiJD/jdBasic/blob/main/vscode_extension/vscode_readme.md)\n\n```\nsrc/        - interpreter source (lexer, parser, compiler, VM, runtime modules)\nbridges/    - optional native bridges (SQLite, Python, ...)\nembed/      - Godot GDExtension (jdb_godot) that embeds the VM in Godot 4\nembedded/   - the microcontroller ports: RP2350/PicoCalc, ESP32-S3, bare metal\ngodot/      - Godot projects: rpg-native (LLM RPG), audioviz, livecoder, jd-one\njdb/        - example .jdb programs - start at the sample gallery, jdb/README.md\nfluppi/     - \"Vallys Reise\", a complete top-down RPG written in jdBasic\ndoc/        - documentation (see the table above) and doc/img/ screenshots\ntests/      - regression suite; tests/gate/ holds the pre-commit gate suites\nmodules/    - modules that IMPORT finds by name from the working directory\nresources/  - icon, manifest, version info, the bundled TTF fonts\ntools/      - auxiliary scripts\nwasm/       - the browser build behind jdbasic.org/live\nvscode_extension/ - VS Code extension (.vsix) and install instructions\nlibs/       - third-party libraries (not in git, see doc/BUILD.md)\nbuild/      - compile output (not in git)\n```\n\nThe same interpreter runs on microcontrollers, under `embedded/`. The\nRP2350 build is what a PicoCalc is; the ESP32-S3 build runs on a bare\nDevKitC and on the 2.8 inch ES3C28P display board, which boots into its\nown prompt on the glass with a panel, a touch screen, sound, a\nmicrophone and a card slot. Both read the language documented in\n[doc/languages.md](/AtomiJD/jdBasic/blob/main/doc/languages.md) without exception. See the chapter\n\"On a board\" there for what each machine has, and\n[embedded/esp32/README.md](/AtomiJD/jdBasic/blob/main/embedded/esp32/README.md) for how that board\nwas brought up.\n\nContributions, bug reports, and feedback are welcome - **[CONTRIBUTING.md](/AtomiJD/jdBasic/blob/main/CONTRIBUTING.md)** has the full guide (build, commit conventions, code style). The core rule: the regression gate stays green. Four gate suites cover the language, the native compiler, and the APL pipeline:\n\n```\n./build/jdBasic.exe tests/gate/comprehensive_test.jdb\n./build/jdBasic.exe tests/gate/native_test.jdb\n./build/jdBasic.exe tests/gate/test_apl_complete.jdb\n./build/jdBasic.exe tests/gate/test_apl_pipelines.jdb\n```\n\nAll four should report `0 failed`. For changes that touch the LLVM codegen, run each suite again through the compiler (`./build/jdBasic.exe -c tests/gate/<suite>.jdb`, then run the produced `.exe`) so both the interpreter and native paths stay green. The full test-bank layout, naming conventions and the GUI smoke procedure are described in [tests/README.md](/AtomiJD/jdBasic/blob/main/tests/README.md). C++ conventions live in [doc/CODING_STYLE.md](/AtomiJD/jdBasic/blob/main/doc/CODING_STYLE.md).\n\n**MIT** - see [LICENSE.txt](/AtomiJD/jdBasic/blob/main/LICENSE.txt). Third-party components are listed in [THIRD_PARTY_LICENSES.txt](/AtomiJD/jdBasic/blob/main/THIRD_PARTY_LICENSES.txt).", "url": "https://wpnews.pro/news/show-hn-i-rewrite-my-game-while-it-is-still-running", "canonical_source": "https://github.com/AtomiJD/jdBasic", "published_at": "2026-09-09 12:49:30+00:00", "updated_at": "2026-09-09 13:15:11.799575+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents"], "entities": ["jdBasic", "Claude", "AtomiJD", "MCP", "Godot", "ONNX", "llama.cpp", "SDL3"], "alternates": {"html": "https://wpnews.pro/news/show-hn-i-rewrite-my-game-while-it-is-still-running", "markdown": "https://wpnews.pro/news/show-hn-i-rewrite-my-game-while-it-is-still-running.md", "text": "https://wpnews.pro/news/show-hn-i-rewrite-my-game-while-it-is-still-running.txt", "jsonld": "https://wpnews.pro/news/show-hn-i-rewrite-my-game-while-it-is-still-running.jsonld"}}