Repository navigation
jdBasic 1.3 - 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
New
- Text that counts characters:
LENW,MIDW$,LEFTW$,RIGHTW$,
INSTRWcount UTF-8 characters whereLEN/MID$count bytes (#921,
53d9658). UCASE$/LCASE$beyond ASCII: Latin-1, Latin Extended-A, Greek and
Cyrillic change case the same in both runtimes, so a case-blind compare of
names with umlauts works (jdbook #840, 30e16b5).TXTWRITER/TXTENCODING$:utf-16le-bomandutf-16be-bom; the
detected encoding name round-trips byte for byte, an append adds no second
mark (#893, 7364d10).- Graphics:
GFX.NEWTARGET/GFX.TARGETdraw into an image,
GFX.DRAWQUADplaces an image on any four corners (ed0579a);
GFX.STROKEdraws thick lines with round ends (08f7a92);GFX.LINES
draws many lines in one call (a503aa2);GFX.NEWTARGET(w, h, FALSE)keeps
hard pixel edges (a57d99c); fonts stay open per size and renderedTEXT
is cached (0627dd6).RASTERdraws SVG markers (91943c5). - Synth (packs with GFX):
SOUND.SINGsings a lyric through a vocoder,
a syllable a note (e71c520, fcd8395);SOUND.VOCODER; sampler
SOUND.SAMPLE,SOUND.SAMPLELOOP,SOUND.GRAIN(#940); wavetables
SOUND.WAVETABLE(#941); modulation matrixSOUND.MATRIX,
SOUND.MODLFO,SOUND.MODSRC(#932);SOUND.PARAMand theSYNTHPATCH
module for patches as JSON (#931); key zones with arpeggiator, chords and
scale lockSOUND.ZONE/SOUND.ZONESET(#929, #936),SOUND.PADMAP
(#934),SOUND.INITtakes a buffer size (#927). - Live audio and MIDI (builds with MINIAUDIO / MIDI, not in the four
packs):MON.SYNTHplays the synth on a miniaudio device, under 10 ms
key to speaker in exclusive mode (#927);MON.SYNTHINandSOUND.INPUT
feed a live vocoder (#949);MIDI.ROUTEplays an input port on the synth
inside the audio thread (#928),MIDI.CLOCK/MIDI.CLOCKIN(#937). - Forms:
RICHTEXTgets the VB6 RichTextBox formatting surface (SEL*,
TEXTRTF,SELRTF,RUNS) (#902, 7ec0608);FORM.PRINTRICHprints a
RICHTEXT as shown (#905, bacb076). - Modules:
MDRICH(Markdown as editable rich text, #903, a09d9ad),MDSYNC
(Markdown source and RICHTEXT view in step, tables, #904, #916, 0daaf1f),
TEXTX.FINDWORD/ISWORDCHAR(#905);TESTKIT 1.1(a check after
REPORT()throws, jdbook #885, ba76920);PPTX 1.1(FIT_SCALE,
BULLET_SCALE, jdbook #838, e59462b);
DT 1.1(OFFSET_AT, jdbook #818, c968695);QR 1.1(HALF$, jdbook
#790, d56adc4);XLSX 1.1.0
(XLSX.READ(path$, TRUE)answers dates as text, e76f547) andXLSX 1.0.1
(character references, jdbook #799, 0514ee9);SVG 1.0.1(themeoption,
umlauts in axis
labels, c173104);LLMAPIuses structured output on current Claude models (#909,
503cac7). MATMULwith a 3-D side answers the product per batch, asBMMdoes,
in both backends (#680, gh #11, 330e4ef).STACK$names the whole call path with module and function
(c1e2e48).--lintlists a finding inside an IMPORTed module apart, "In imported
modules, not counted" (jdbook #776, 45499d9).
Changed
SLEEPwaits to about half a millisecond on Windows (a high-resolution
timer instead of the 15.6 ms tick;SLEEP 1took 15 ms) (#948, 0d28912).- A FUNC or SUB defined twice in one file is an error naming both lines
(#924, 1420a71). - TYPE: a keyword cannot name a member (#919, e84a189); under
-ca
member needsAS <type>(#920, 9866a22). - Compiled programs are per-monitor DPI aware like
jdBasic.exe, so
screen sizes and cursor positions are physical pixels in both (jdbook
#862, 7324a05). - A builtin that fails in a compiled program is named in the error text
as in the interpreter:CSVREADER: Cannot open file: ...(#965,
b8574bd). - An array in
IFis read the same in both backends: true when it has
cells and every cell is true; an empty array is false (#964, b8574bd). - The mcp-native pack builds its runtime DLL with HTTP, so compiled programs
of that pack haveHTTP.*(jdbook #788, 7324a05).
Fixed
- Native compiler (
-c), values whose kind only the run knows - the
divergence corpus of #912 went from 192 to 215 of 374 programs identical
in both backends, plus the fixes found by the book's checks:- a text cell handed to a number parameter, a mixed array filled by PUSH
in a FUNC (crashed),IFover an array or a regex match (#962, #963,
#964, b8574bd); - a cell of an untyped array handed to a builtin keeps its kind
(PATH.JOIN$(dir$, files[k]), 1c996c6); a cell added to a string is
read with its own tag (5af347e); - an element of
SORTover a directory list, an array element in a map
literal, a FUNC returning rows, a MAP function returning a JSON field
(jdbook #794, #821, #844, 9287e7a); APPEND(out, part)answers a flat array (640073d);- a RUNTIME array assigned to an array variable,
RETURN call()[0], IIF
over map strings, an INTEGER sum or a FORM value into an untyped
parameter (#906, #907, #910, #911); - JOIN of a VM cell in a FUNC (#913); matrix rows shifted in a FUNC
crashed at random (#915, #922); a FUNC returning a UDT (#724); - an argument that raises goes to CATCH before the SUB or FUNC runs, and
frees its strings (#945); a VM array read at an array of positions
(#947); containers written into a parameter's container are counted
(#925); a variable owning its texts stays owner (#914); - integers stay integer through funcrefs, ASYNC and runtime arithmetic;
m.xon a map is NONE (#742, e76594c); - a lambda called through a variable answers a text as a text
(7601e7e); a VM value on the left ofIN(a044703).
- a text cell handed to a number parameter, a mixed array filled by PUSH
- Interpreter: a text operator with a constant on the right inside a
FUNC or SUB works as at the top level (c60a145). JSON.PARSE: a\uwithout four hex digits stays text, surrogate
pairs become one character (#899, 77ea8ef).PDF.TEXT$: fonts in/ObjStmobject streams (#900); no space after
every glyph (#918); bounded glyph-width memory (beb04c0).FORMAT_DATE$with an unknown conversion raises an error on Linux and
macOS too (#766, a651558).- MCP server:
OS.EXECgives the child NUL as stdin instead of the
JSON-RPC stream (#767, 4bd3d56);jdb_docfindslanguages.mdfor a
server run frombuild/(#765, 0d25921). TXTREADER$without an encoding leaves out a leading UTF-8 byte order
mark (jdbook #768, 30e16b5).
Known limits
- An untyped FUNC parameter is a number slot under
-cwhen every call
hands it a number or a cell the callee only reads as a number: a text
there becomes its number ("5" * 2is 10 compiled,55interpreted)
(#742). - The
-cdivergence corpus still has about 76 programs that print
something else compiled (#912).
Programs written for 1.2 keep running. Two changes can stop a program that ran
before: a FUNC or SUB defined twice in one file, and (under -c) a TYPE member
without AS <type>; both errors name the line.
The gate passes interpreted and through -c on Windows and on all three
farm machines; the 59 module self tests pass 6900 checks interpreted and 6845
compiled (some run only in the interpreter), with none failing.
Downloads (Windows x64, Builds 119 to 122; 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 |
~5.0 MB, Build 119 | Interpreter + MCP server, no LLVM. Smallest footprint. |
jdbasic-mcp-native-windows-x64.zip |
~36.4 MB, Build 120 | Core plus the LLVM native-compile toolchain for jdbasic -c (standalone EXEs), HTTP in compiled programs, and the agent-workshop/ template. |
jdbasic-vibe-game-pack-windows-x64.zip |
~8.9 MB, Build 121 | 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.8 MB, Build 122 | VB6 Pack: native Win32 forms (FORM.*, RICHTEXT), 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. |
SHA256
jdbasic-core-windows-x64.zip 16002C293014B814D09BD3CC2D758F4EAA250F5FBA5D2777BCE38CA6B264FAD7
jdbasic-mcp-native-windows-x64.zip 45FBFDA89019CC05CB763F334807E7149ECFF63390BAA1995DD39138B406EC51
jdbasic-vibe-game-pack-windows-x64.zip 15F1B316DDE273B7EE48F7F5018EC8D4637C10C36C427B3DAFE2DA31A788FB93
jdbasic-vb6-windows-x64.zip C8515C7B05E9C25D2DF0621D7052DA107BCD87D92F976CD40188DA7C8B091B90
Verify with PowerShell: Get-FileHash -Algorithm SHA256 <file>.zip.
First run on Windows. The binaries are Authenticode-signed (certificate:
Open Source Developer Achim Christ). 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", then "Run
anyway". To skip it, right-click the downloaded .zip before extracting,
choose Properties, tick Unblock, and click OK.
Linux and macOS (Build 123)
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 module
library lib/.
| Tarball | Size | Built on |
|---|---|---|
jdbasic-linux-x64.tar.gz |
~10.4 MB | Ubuntu 24.04 LTS, GCC 13.3, generic x86_64 |
jdbasic-linux-x64-cortex.tar.gz |
~10.5 MB | Ubuntu 25.10, GCC 15.2, generic x86_64 |
jdbasic-macos-arm64.tar.gz |
~8.2 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. These builds leave out SQLite, so
DB and the jdweb sign-in need a build with SQLITE=1. Both platforms link
the system libssl and libcrypto.
These are not code-signed. macOS puts a downloaded tarball in quarantine;
clear it once after unpacking:
xattr -dr com.apple.quarantine jdbasic-macos-arm64
SHA256
jdbasic-linux-x64.tar.gz 241ab5264c40114c9bd8d4ea2b56cfe3324a8137ef5c565cee56f16739ae8737
jdbasic-linux-x64-cortex.tar.gz 61ad04a009e1c135d55cafb84bf158828ed09089bcc13b4c998a7595f84f6bc7
jdbasic-macos-arm64.tar.gz ec913a3f12afecc0c3037a1acf6cb993364fdc2719a785f6e3479433277268b0
Verify with sha256sum <file> on Linux, shasum -a 256 <file> on macOS.
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 upload.
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 - Release notes: doc/release_notes/v1.3.0.md - Source and issues: https://github.com/AtomiJD/jdBasic