Skip to content

jdBasic 1.2

Choose a tag to compare

@AtomiJD AtomiJD released this 26 Oct 13:48
· 913 commits to main since this release

Superseded by jdBasic 1.3. These downloads stay for reference.

jdBasic 1.2 - a modern BASIC built on a bytecode VM, with APL-style array
programming, native compilation, SDL3 graphics, a game layer, a local AI stack,
and a built-in MCP server that lets any AI agent drive a persistent VM:
run code, compile it to a standalone EXE, and even pause a running program to
live-tweak it and resume.

New here? Try it in the browser first (no download): https://jdbasic.org/live/index.html
Learn it: the Train jdBasic video series - https://www.youtube.com/playlist?list=PLowaSH4O3MGq-veO7qSIp-9EntEjY_iPZ


Refresh of 26 October 2026: one spelling for names, keys and handlers

This refresh makes the language consistent in five places. Programs written
for earlier 1.2 builds keep running: the old names and forms still work, and
--lint, -c and the MCP tool jdb_check name every use with its
replacement. One change is not compatible: MAT4.ROTATE now takes
degrees
(see below). The full list is in
doc/name-changes.md.

  • A name ends in $ exactly when it answers a string. STR, CHR,
    LEFT, MID, TRIM, FORMAT_DATE, REGEX.REPLACE, GUI.INPUT,
    AI.CHAT and the other string builtins without a $ resolve to their $
    form; DIR$ becomes FILE.LIST, and INSTR$, JSON.PARSE$,
    TILED.LAYERS$ and HTTP.*_ASYNC$ drop the $. TYPEOF, JOIN and the
    date functions keep their names. LEFT, RIGHT and MID are now the same
    functions as their $ forms: a number passed as the text is turned into a
    string, and MID past the end answers "" instead of raising an error.
    JDB.ALIASES() returns the table.
  • Maps from builtins use lower-case keys: request{"body"},
    OS.EXEC(..){"exit_code"}, QR(m){"q"}, NODE.PEERS()[0]{"name"}. A
    read of the old upper-case key still finds the value and prints one
    warning; a map the program builds keeps its keys exactly. The NODE protocol
    between machines is unchanged.
  • Every handler is a funcref: HTTP.SERVER.ON_GET "/", Home@,
    ON "TICK" CALL OnTick@. A handler named by a string still works.
  • EXITSUB and EXITSWITCH. EXITFOR, EXITDO and CONTINUE... out of
    a SWITCH no longer leave a value on the VM stack each time (3 million
    such exits held 100 MB).
  • Math in radians, graphics in degrees. New: RADIANS() and DEGREES(),
    element-wise on arrays. MAT4.ROTATE takes degrees like the other
    graphics calls; code that passed radians calls MAT4.ROTATE_RAD.
  • tools/jdb-fix.jdb moves a project to the new names. It is written in
    jdBasic and reads the source token by token, so strings, comments and
    members stay as they are. Run over the repository's own jdb/ and lib/:
    907 files, 164,840 lines, 998 changes in 313 files. Afterwards --lint
    finds no old name, every changed file in jdb/ lints and compiles with
    -c exactly as it did before, and the module self tests pass as before.

Also in this refresh:

  • MCP: what a loaded program prints reaches the agent. jdb_load and
    jdb_resume wait up to wait_ms (default 2 s) for the next STOP or the
    end and answer with the output so far; later output and a runtime error
    come with the next jdb_status, jdb_eval or jdb_resume.
  • Agent workshop (agent-workshop/ in the mcp-native pack): a template
    that turns any project into a jdBasic workshop for Claude Code and other
    MCP clients - a persistent VM whose data and helper functions are saved
    per project and come back in the next session.
  • Fixed: RAISEEVENT "X", 1 with a number crashed a compiled program.

New in 1.2

1.2 collects 213 commits since 1.1.0. Most of the 1.1 refreshes of 17 and
25 October (the live-coding sequencer, the Node Bus, compiled array math on
every core, compiled programs that free what they no longer hold) are part of
it and are summarised at the end. What is new since the last 1.1 downloads is
mostly one thing: a ten-part audit of the compiler, the runtime, the VM and
the libraries
, and every finding it turned up fixed with a regression test.

A program does not crash where it used to

  • HTTP handlers never race the program. A handler runs one at a time and
    never beside the main program or another handler: while the program waits
    (HTTP.SERVER.WAIT, SLEEP, AWAIT, CHAN.RECV, INPUT, OS.EXEC, an
    HTTP client call) or, interpreted, between two of its instructions. No
    global is read or written by two threads at once. A compiled program that
    runs a long loop without waiting holds its handlers back until it waits.
  • COM against a busy server. Excel loading a workbook's VBA project
    rejects calls for a few seconds; jdBasic now tries them again for up to
    30 seconds, as VBA and .NET clients do, instead of failing and then
    crashing with an access violation on the next call.
    • An unknown member of a COM object is an error the program catches. It
      was read as a jdBasic map, which ended the process.
    • Every COM error carries the HRESULT: COM: Failed to call 'GETFILE' (0x800A0035).
    • An object assigned to a property goes by reference, as VBA's Set:
      vbe.ActiveVBProject = wb.VBProject.
    • COM.MISSING() leaves an optional argument out:
      bars.FindControl(COM.MISSING(), 2578, COM.MISSING(), FALSE, TRUE).
  • Deep or hostile input raises an error a TRY catches instead of ending
    the process: expressions and chains nested thousands deep (parser,
    compiler, --lint, JSON), a regex the engine gives up on, a ZIP entry whose
    size or CRC-32 does not match, a PDF font map or an inflate stream far
    larger than any real file, a string, array or RANGE too large for memory.
    jdBasic and every compiled program reserve 64 MB of stack.
  • No C++ exception leaves the runtime into compiled code. An allocation
    that fails inside SELECT, FILTER, REDUCE, AGG, OUTER or an event
    handler raises the error in the program.
  • The interpreter's core keeps its bookkeeping straight. A RETURN of a
    local ends the frame's TRY blocks; the fused opcodes grow the stack
    before they read it; -1 * INT64_MIN no longer traps; jumps, constants and
    names past 65535 are a compile error instead of a wrong jump; a function
    redefined while a frame runs inside it keeps that frame's code; a TYPE's
    MAP and ARRAY members are new per instance instead of shared.
  • Library edges answer correctly or raise an error: FORMAT_DATE with a
    specifier the C library rejects, PATH.NORMALIZE$ on a UNC path,
    SETLOCALE keeping numbers readable in both backends, PUSH, POP,
    MAP.MERGE and MAP.CLEAR on a value of the wrong kind, CD and PWD
    beyond MAX_PATH.
  • Security: the debug adapter (--debug) listens on loopback only.
    jdbasic -c runs link.exe and rc.exe without a shell, so no character
    in a path starts a command, and OS.EXEC hands the child only its own
    pipes.

The compiled program answers what the interpreter answers

jdbasic -c closed a long list of places where a value whose kind is known
only at run time (a map value, a cell of a mixed array, an untyped
parameter) came out differently from the interpreter:

  • Division by zero raises Division by zero.
  • A string meets a number through the string operators: + joins, *
    repeats, / slices, a string minus a string removes.
  • A number compared with a string is unequal, and a string counts as 0 in
    an ordering, as interpreted.
  • AND and OR evaluate both sides; ANDALSO and ORELSE stop early. A
    number AND an array works element-wise. An empty string is false.
  • An ASYNC FUNC and a TYPE method receive a string argument as a string.
  • SELECT over a function that answers a number for some cells and a
    string for others keeps each kind; INSTR, REDUCE and CVDATE keep the
    kind of a map value they are handed.
  • FOR EACH stops at the current end of an array its body shrinks.
  • Indexing a number raises Cannot index into, VAL of a number is that
    number, MIN, MAX and LEN of a run-time value answer as interpreted.
  • A string FUNC answers a string, a RETURN of a number from one answers
    its text, and a FUNC returning TYPEOF(...) is a string function.

Compiled programs free what they hold, and run faster

  • FOR EACH sweeps its temporaries every 64 passes: one loop went from
    3.2 GB to 16 MB.
  • POP no longer pins its array (every POP in a loop leaked the array),
    owned buffers are freed once and never while still read, and the regex
    cache stops at 512 patterns.
  • Maps of 16 keys or more find keys through a hash index. Measured,
    compiled:
before now
50000 keys written and read back in a map 7568 ms 46 ms
TRANSPOSE of 25600 x 32 38 ms 2 ms
UNIQUE of 20000 cells 463 ms 4 ms
DIFF of 20000 by 20000 289 ms 4 ms
20 array literals of 3000 cells 41 ms 0 ms

For AI agents and language models

  • llms.txt and llms-full.txt at the repository root and on
    jdbasic.org: the index and the full
    documentation in one file, about 790 KB, for any AI tool that reads them.
  • jdBasic for language models:
    the rules a model gets wrong when it guesses (0-based strings, 1-based
    IOTA, no string escapes, AND against BAND, MAX of one array, the
    NONE comparison, SUB scoping), the syntax with examples CI runs, and
    the MCP server.

Already shipped as 1.1 refreshes, now part of 1.2

  • A live-coding sequencer: SOUND.SEQ with Strudel-style mini-notation,
    a synthesized drum kit, filters, sidechain and effect orbits; SOUND.AT
    and SOUND.RECORD; SOUND.LIMITER, SOUND.LOUDNESS (EBU R128) and live
    mixing.
  • The Node Bus: NODE.JOIN, topics, calls and inboxes between programs,
    on one machine or across the LAN with HMAC-authenticated links; the MCP
    server lists nodes and reads topics (jdb_nodes, jdb_peek).
  • Processes: OS.SPAWN, OS.WAIT, OS.ALIVE, OS.KILL, OS.PID,
    OS.SELF$, OS.LOAD.
  • Numerics on Eigen: MATMUL_T, BMM, SOLVE, INVERT; compiled array
    math in row bands across all cores; one broadcasting rule in both
    backends; reducers with an axis on n-D arrays.
  • Compiled programs free arrays and maps once nothing holds them;
    SYS.HEAP() reports the heap in both backends.
  • 56 modules, among them RASTER (SVG to PNG without a window).
  • GFX.BLEND, JPEG screenshots, DECLARE FUNC with DOUBLE and buffer
    parameters, CSVWRITER with significant digits.

Every pack was built from commit 9847e4cd. The gate (four suites,
interpreted and compiled) passes on Windows, both Linux machines and the
Mac. The 56 module self tests (6751 assertions interpreted,
6698 compiled) pass on Windows, and the full parity sweep shows no
regression against its baseline.


Downloads (Windows x64, Builds 115 to 118; Linux and macOS below)

Every bundle ships the app-local Visual C++ runtime, so it runs on a clean
Windows with no redistributable installed. Each also ships the full help.txt
reference (HELP in the REPL), doc/languages.md, the module library lib/,
curated examples and THIRD_PARTY_LICENSES.txt.

Bundle Size What you get
jdbasic-core-windows-x64.zip ~4.9 MB, Build 115 Interpreter + MCP server, no LLVM. Smallest footprint.
jdbasic-mcp-native-windows-x64.zip ~35.9 MB, Build 116 Core plus the LLVM native-compile toolchain for jdbasic -c (standalone EXEs).
jdbasic-vibe-game-pack-windows-x64.zip ~8.7 MB, Build 117 GFX/ImGui build with ready-to-run game demos, launchers, and an AI pair-coding quickstart. Embedded SQLite (SQL.*) for highscores and save state, plus WAV I/O and the effects chain (WAV.*, FX.*).
jdbasic-vb6-windows-x64.zip ~37.4 MB, Build 118 VB6 Pack: native Win32 forms (FORM.*), COM automation (Excel/Word/Outlook via CREATEOBJECT), embedded SQLite (SQL.*), GFX/ImGui/HTTP, the MCP server and the native compiler, so a forms program becomes an .exe. Ships forms demos incl. .jdform layouts from the VS Code visual designer.

SHA256

jdbasic-core-windows-x64.zip           32C2076DF2A9420624BB51CC61539F9B6C4F3995AB0A6629917A0D77C8B932C7
jdbasic-mcp-native-windows-x64.zip     FD3DF9186CA55984F45C45802BC9C38EE3F8AB88AC99904F3D61BE4A6164C4AC
jdbasic-vibe-game-pack-windows-x64.zip 68B2DC6BB5ED5048488BF0677B08650377AC7328E9ED7ACC024FF3BA11F5CBB8
jdbasic-vb6-windows-x64.zip            22C97818CCB6C46BC483EB9EB55FB9618B33A0469C91C3817A3E27E210E1813F

Verify with PowerShell: Get-FileHash -Algorithm SHA256 <file>.zip.

First run on Windows. The binaries are Authenticode-signed (certificate:
Open Source Developer Achim Christ). Because the signature is new, Microsoft
Defender SmartScreen may show a "Windows protected your PC - unrecognised app"
notice the first time you start jdBasic.exe. This is a reputation prompt,
not a malware detection - the signed publisher is shown right in the dialog.
Click "More info" if the button is hidden, then "Run anyway". To skip it
entirely, right-click the downloaded .zip before extracting, choose
Properties, tick Unblock, and click OK - then no extracted file carries the
"downloaded from the internet" mark.


Linux and macOS (Build 119)

Three tarballs, each a directory you unpack anywhere and run from: jdbasic
(the interpreter and MCP server), libjdbrt.so beside it, jdb_runtime.o for
the native compiler, help.txt, a README.txt, doc/ and the whole
fifty-six-module lib/.

Tarball Size Built on
jdbasic-linux-x64.tar.gz ~10.0 MB Ubuntu 24.04 LTS, GCC 13.3, generic x86_64
jdbasic-linux-x64-cortex.tar.gz ~10.1 MB Ubuntu 25.10, GCC 15.2, generic x86_64
jdbasic-macos-arm64.tar.gz ~7.9 MB macOS 15.6, Apple Silicon, clang + LLVM 18

The two Linux tarballs are the same program built by two different compilers
on two different distributions, for coverage. Take either.

tar -xzf jdbasic-linux-x64.tar.gz
cd jdbasic-linux-x64
./jdbasic                       # the REPL
./jdbasic hello.jdb             # run a program
./jdbasic -c hello.jdb          # compile it, then ./hello.exe

Nothing has to be set: the binary finds its runtime beside itself and a
compiled program carries the same path, so it runs from any directory.
IMPORT DF and the rest of the library work out of the box, and
JDBASIC_PATH=<dir>/lib points a program elsewhere at it. These builds leave
out SQLite, so DB and the jdweb sign-in need a build with SQLITE=1.

No OpenSSL is bundled. Both platforms link the system libssl and
libcrypto, which every current distribution and Homebrew already have.
Only the Windows core bundle ships those DLLs.

These are not code-signed. The certificate is Windows-only, so macOS
puts a downloaded tarball in quarantine and refuses to start the binary.
Clear it once after unpacking:

xattr -dr com.apple.quarantine jdbasic-macos-arm64

SHA256

jdbasic-linux-x64.tar.gz         feb9518163ed6147aadb97ad497ad54fc1fd0af70a39bb9ae41c5e553880c08f
jdbasic-linux-x64-cortex.tar.gz  fb263a1b10dbc5525c33a99ac935a15a9c227443a4f0b0bb6494b936a519cc79
jdbasic-macos-arm64.tar.gz       97a0bb56f1050d025f349f99c588b20700024361be52a1f876dd219020e0823c

Verify with sha256sum <file> on Linux, shasum -a 256 <file> on macOS.

The gate passes interpreted and through -c on all three machines. Each
tarball was unpacked into an empty directory on its own machine, then ran a
program, an IMPORT and a -c compile from there before it was uploaded.


Use it as an MCP server

{
  "mcpServers": {
    "jdbasic": { "command": "C:\\path\\to\\jdBasic.exe", "args": ["--mcp"] }
  }
}

Full client config and the tool reference are in doc/MCP.md, which also ships inside every bundle.


Language reference: doc/languages.md - Source and issues: https://github.com/AtomiJD/jdBasic