Windows + bare UEFI
Run as a native Windows x64 application or boot straight into BASIC on x64 UEFI hardware.
THOREAU BASIC 2.5.2 · WINDOWS x64 · UEFI x64
A free 64-bit BASIC interpreter for Windows x64 and bootable x64 UEFI. Write GW-BASIC-style line-numbered programs, run them on Windows or directly from firmware without an operating system, package them as standalone EXE/EFI applications, and use international keyboard layouts on bare-metal UEFI.
V2.5.2 keeps PARFOR workers alive across repeated loops, removes major UEFI firmware-launch overhead, hardens JIT cache lifetime and input cleanup, and adds Island3D as a mouse-only first-person terrain showcase.
V2.5.2
Version 2.5.2 is a runtime-performance and robustness update for programs that hit the JIT and PARFOR continuously. Compiled PARFOR source regions are reused instead of consuming code-cache space on every invocation, and RUN now forms a clean token/JIT cache boundary before variables are recreated.
Windows already used persistent PARFOR workers. UEFI now does too: application processors are started through EFI MP Services only when the pool grows, then remain parked inside Thoreau and receive later jobs through shared work counters while the BSP participates. This removes firmware AP-launch/event overhead from frame-by-frame parallel loops.
On supported bare-metal x64 systems Thoreau can enable AVX/YMM state itself when firmware leaves it disabled, reports framebuffer write-combining status, and uses a faster bulk path for PUT ...,PSET. Both platforms also discard queued gameplay keystrokes when RUN or CONT returns to Ready., so old movement keys do not reappear later in the editor or LIST pager.
PARFOR X=0 TO 639
reuse the same native worker graph frame after frame
OPTION PARTHREADS 0
let Thoreau tune the persistent worker pool
RUN "ISLAND3D"
1024×1024 fractal terrain, mouse-only controls
V2.5
Thoreau BASIC 2.5 turns the experimental compiler work into a normal execution path on both Windows x64 and x64 UEFI. Stored programs can compile hot numeric and hypercomplex expressions, scalar and numeric/@ array work, assignments, IF/ELSE, FOR/NEXT, WHILE/WEND, DEF FN and large cross-line regions into native x64 code. Unsupported syntax simply drops back to the classic interpreter.
Classic line-numbered control flow is not treated as embarrassing luggage. Literal GOSUB/RETURN can stay native across compiled regions, including calls made from hot loops. The JIT preserves BASIC return points and single-line IF/ELSE context when a call has to fall back to the interpreter. JIT OFF disables both bytecode and native acceleration for a clean correctness A/B test; JIT ON restores it.
PROFILE now knows which engine executed each line. JIT sampling modes report RUNS, JITRUNS, INTRUNS and MODE, while PROFILE INTERPRETER gives an exact classic-engine comparison. The new GorseGlass demo puts the machinery under load with a 1024×768 raytracer using nested loops, arrays, many GOSUBs, reflections, true Snell refraction and Schlick Fresnel blending.
JIT OFF : RUN
force the classic interpreter for an A/B correctness test
JIT ON : PROFILE JIT : RUN
run compiled and see which lines stayed native
PROFILE INTERPRETER : RUN
exact interpreter-only timing for comparison
V2.4.1
V2.4.1 added FIND NEXT/PREV/WORD, source REPLACE, syntax-aware XREF and AUDIT, the first line profiler, REDIM, FOR END/WHILE END, POLYFILL, graphics-slot introspection and several control-flow and input refinements.
V2.4
Games can now ask what is held right now with KEYDOWN(), so movement and firing
no longer fight over INKEY$. Mouse support is shared across Windows and UEFI, with position,
buttons, wheel, ON MOUSEMOVE and ON MOUSECLICK. UEFI draws its own software pointer,
probes both Simple and Absolute Pointer protocols, and can fall back to a raw PS/2 mouse when firmware
publishes pointer protocols that never deliver motion. MOUSEINFO shows which backend is active.
Windows SCREEN width,height now accepts arbitrary logical framebuffer sizes and scales them
cleanly into windows or fullscreen with preserved aspect ratio. UEFI exposes its real GOP modes through
SCREEN MODES, VIDEOMODES(), VIDEOMODE and SCREEN MODE.
Networking is now a BASIC feature rather than wishful thinking: eight TCP/IPv4 client slots, DNS,
HTTPGET$(), HTTP status and network-error reporting use Winsock/WinHTTP on Windows. UEFI first
uses firmware DNS4/TCP4/HTTP, but can now drop to EFI_SIMPLE_NETWORK_PROTOCOL and run Thoreau's
own ARP, DHCPv4, IPv4, UDP, DNS and TCP stack. It probes real packet I/O even when firmware reports a
stale media-present flag. NETINFO exposes exactly which path is active. Plain HTTP works on the
raw fallback; authenticated HTTPS still uses the firmware HTTP/TLS stack.
Classic compatibility also gets quieter but important fixes: INPUT ; keeps the cursor on the
current line, NEXT K,J,I closes several nested loops, and DEFxxx defaults now make an unsuffixed
variable and its matching explicit suffix the same variable, as in GW-BASIC.
IF KEYDOWN("LEFT") AND KEYDOWN("SPACE") THEN GOSUB 9000
move and fire in one frame
ON MOUSECLICK GOSUB 8000
event-driven pointer input
MOUSEINFO
show UEFI pointer protocols, PS/2 fallback and active backend
NETINFO
show firmware protocols, raw-stack DHCP and active backend
J$=HTTPGET$("http://api.open-notify.org/iss-now.json")
live ISS data even through the raw UEFI fallback
WHAT IT IS
GW-BASIC-shaped on the surface, but built for 64-bit systems, real framebuffers and bare firmware.
Run as a native Windows x64 application or boot straight into BASIC on x64 UEFI hardware.
CREATEEXE and CREATEEFI turn the loaded BASIC program into a self-contained application.
64-bit integers, 64-bit addresses, wide PEEK/POKE operations and a large modern memory arena.
Classic PSET, LINE, CIRCLE, PAINT, COLOR, GET/PUT and DRAW run on a 24-bit framebuffer with direct RGB colors, plus LOADBMP, BITBLT and SAVEBMP.
Inspect memory, disks, sectors, partitions, filesystems, boot entries and machine landmarks from inside BASIC.
KEYB and THOREAU.CFG select from 23 layouts. On supported bare metal, raw USB HID input avoids firmware key-mapping problems.
SYSTEM returns a UEFI build to firmware so boot can continue, while the Windows build simply exits.
65,536 image slots and 65,536 persistent instances, transparent-color masks, movement, visibility, text layering and pixel-perfect collision.
The @ type brings complex numbers, quaternions and octonions into ordinary BASIC expressions, arrays, powers and transcendental functions.
KEYDOWN reads simultaneous held-key state, KEYREPEAT controls typematic behavior and WAITREL provides relative frame pacing.
Automatic string GC and reusable array/bitmap blocks keep long-running programs from leaking the BASIC arena away.
LOAD and MERGE accept literal TAB characters in ASCII source and expand them to 4-column tab stops.
Position, buttons, wheel and non-preemptive move/click handlers work on Windows and UEFI. UEFI can use Simple/Absolute Pointer or fall back to raw PS/2, with MOUSEINFO diagnostics.
Use arbitrary logical raster sizes on Windows or enumerate and select physical/GOP modes with VIDEOMODES, VIDEOMODE and SCREEN MODE.
Eight TCP/IPv4 clients, DNS and HTTPGET$ work through Windows networking, firmware UEFI protocols, or Thoreau's own SNP-based ARP/DHCP/IPv4/UDP/DNS/TCP stack. NETINFO shows protocols, DHCP state, addressing, media report and active backend.
INPUT ; cursor retention, multi-variable NEXT and GW-BASIC-compatible DEFxxx variable identity close several subtle language gaps.
Windows and UEFI can compile supported stored BASIC into native x64 code, including numeric/@ arrays, loops, IF/ELSE and GOSUB-heavy program regions. Unsupported statements fall back automatically, and JIT OFF restores the classic interpreter completely.
THE PROOF
A complete Thoreau BASIC game released three ways: editable BASIC source, a Windows executable, and an EFI application that can boot directly into the game. The Pixel Prose .BAS source is included with the Thoreau BASIC example programs.
Pixel Prose for Windows, including the required BMP asset directory.
Download PixelProse-Windows.zip → .ZIPBootable Pixel Prose package with the EFI application and required BMP assets.
Download PixelProse-UEFI.zip →\EFI\BOOT\BOOTX64.EFI
The UEFI ZIP contains the EFI application and its assets. Put the EFI application at this path on a suitable x64 UEFI boot volume and the firmware launches the game directly.
V2.5.2 SHOWCASE
The examples are meant to exercise real features hard enough to be useful starting points, not just sit politely beside the syntax reference.
A 1024×768 analytic raytracer and JIT stress test with checkerboard floor, hard shadows, Phong highlights, reflective materials and a glass sphere using explicit entry/exit Snell refraction with Schlick Fresnel blending.
A first-person fractal terrain renderer with a 1024×1024 heightfield, fog, directional lighting, trees, double buffering and a PARFOR column renderer. The running demo is mouse-only: move to look, hold left to walk forward, right to walk backward, and both buttons to quit.
A compact Space-Invaders-style sprite demo with persistent instances, transparency, collision detection and projectiles. KEYDOWN now allows movement and firing simultaneously.
A 1024×768 vertically scrolling shooter with many simultaneous sprites, HUD text, WAITREL pacing and continuous BITBLT scrolling.
A keyless live ISS demo using the public Open Notify HTTP endpoint, so it also exercises Thoreau's raw UEFI network fallback while plotting an orbital trail across the world map.
A small paint program demonstrating pointer position, buttons, wheel-controlled brush size and ON MOUSEMOVE / ON MOUSECLICK handlers across the Windows, UEFI pointer and raw PS/2 backends.
Shows the difference between queued INKEY$ events and current held-state input by moving and firing at the same time with KEYDOWN.
Enumerates physical/display modes with VIDEOMODES and VIDEOMODE and demonstrates SCREEN MODE selection on both platforms.
A 2D Mandelbrot renderer using native complex syntax: C@=CPLX(CR,CI) and Z@=Z@*Z@+C@.
A ray-marched three-dimensional slice of a four-dimensional quaternion Julia set using QUAT(), NORM, LOG and 24-bit graphics.
DOWNLOADS
Pick your floor. Windows, or the firmware beneath it.
Windows build with the production x64 JIT, persistent multicore PARFOR, compiled-region reuse, RUN/JIT cache hardening, clean post-game keyboard queues, JIT-aware PROFILE, mouse input/events, TCP/DNS/HTTP(S), CREATEEXE, sprites, graphics and the complete example set including GorseGlass and Island3D.
Ready-to-boot VHD with the x64 UEFI JIT, persistent PARFOR AP pool through MP Services, bare-metal AVX/YMM enablement, framebuffer WC diagnostics, faster full-frame PUT, mouse input with raw PS/2 fallback, firmware/SNP networking, CREATEEFI and the full example set including GorseGlass and Island3D.
UEFI build with the production x64 JIT, persistent PARFOR AP pool, compiled-region reuse, bare-metal AVX/YMM setup, framebuffer WC diagnostics, fast PUT presentation, JIT-aware PROFILE, mouse and raw USB HID input, GOP modes, firmware/SNP networking, CREATEEFI, documentation and examples.
Overview, quick start, complete command reference, examples and Thoreau extensions.
CONTACT / SUPPORT
Questions, bug reports, compatibility notes or feedback? Get in touch.
If you want to support development, you can make a voluntary PayPal contribution.
QUICK START
10 CLS
20 PRINT "HELLO FROM THOREAU BASIC"
30 FOR I=1 TO 5
40 PRINT I
50 NEXT I
60 END
RUN
“I make myself rich by making my wants few.”Henry David Thoreau