Repository navigation
jdBasic 1.2
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.CHATand the other string builtins without a$resolve to their$
form;DIR$becomesFILE.LIST, andINSTR$,JSON.PARSE$,
TILED.LAYERS$andHTTP.*_ASYNC$drop the$.TYPEOF,JOINand the
date functions keep their names.LEFT,RIGHTandMIDare now the same
functions as their$forms: a number passed as the text is turned into a
string, andMIDpast 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. EXITSUBandEXITSWITCH.EXITFOR,EXITDOandCONTINUE...out of
aSWITCHno 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()andDEGREES(),
element-wise on arrays.MAT4.ROTATEtakes degrees like the other
graphics calls; code that passed radians callsMAT4.ROTATE_RAD. tools/jdb-fix.jdbmoves 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 ownjdb/andlib/:
907 files, 164,840 lines, 998 changes in 313 files. Afterwards--lint
finds no old name, every changed file injdb/lints and compiles with
-cexactly 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_loadand
jdb_resumewait up towait_ms(default 2 s) for the nextSTOPor the
end and answer with the output so far; later output and a runtime error
come with the nextjdb_status,jdb_evalorjdb_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", 1with 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).
- An unknown member of a COM object is an error the program catches. It
- Deep or hostile input raises an error a
TRYcatches 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 orRANGEtoo 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 insideSELECT,FILTER,REDUCE,AGG,OUTERor an event
handler raises the error in the program. - The interpreter's core keeps its bookkeeping straight. A
RETURNof a
local ends the frame'sTRYblocks; the fused opcodes grow the stack
before they read it;-1 * INT64_MINno 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; aTYPE's
MAPandARRAYmembers are new per instance instead of shared. - Library edges answer correctly or raise an error:
FORMAT_DATEwith a
specifier the C library rejects,PATH.NORMALIZE$on a UNC path,
SETLOCALEkeeping numbers readable in both backends,PUSH,POP,
MAP.MERGEandMAP.CLEARon a value of the wrong kind,CDandPWD
beyondMAX_PATH. - Security: the debug adapter (
--debug) listens on loopback only.
jdbasic -crunslink.exeandrc.exewithout a shell, so no character
in a path starts a command, andOS.EXEChands 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. ANDandORevaluate both sides;ANDALSOandORELSEstop early. A
numberANDan array works element-wise. An empty string is false.- An
ASYNC FUNCand aTYPEmethod receive a string argument as a string. SELECTover a function that answers a number for some cells and a
string for others keeps each kind;INSTR,REDUCEandCVDATEkeep the
kind of a map value they are handed.FOR EACHstops at the current end of an array its body shrinks.- Indexing a number raises
Cannot index into,VALof a number is that
number,MIN,MAXandLENof a run-time value answer as interpreted. - A string
FUNCanswers a string, aRETURNof a number from one answers
its text, and aFUNCreturningTYPEOF(...)is a string function.
Compiled programs free what they hold, and run faster
FOR EACHsweeps its temporaries every 64 passes: one loop went from
3.2 GB to 16 MB.POPno longer pins its array (everyPOPin 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.txtandllms-full.txtat 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,ANDagainstBAND,MAXof one array, the
NONEcomparison,SUBscoping), 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.SEQwith Strudel-style mini-notation,
a synthesized drum kit, filters, sidechain and effect orbits;SOUND.AT
andSOUND.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 FUNCwithDOUBLEand buffer
parameters,CSVWRITERwith 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