AdaLogic BASIC
AdaLogic BASIC (ALB) is a complete programming language and SDK — a modern BASIC dialect built for learning and for building real software, from games to tools to full applications. It pairs a deliberately beginner-readable surface syntax with a strict static type system, an event-driven program model, and a native toolchain.
History
Origins
My story starts with an early brush with computing gone wrong. I was born June 10, 2000, and as a very young child — kindergarten or thereabouts — I had a teacher who split the class into students she believed she could teach and students she simply stopped helping. The day the class first used a computer, I had never touched one (my family had no computer at home) and got no instruction beyond "go type this." Fellow students tried to help; the teacher did not. I went home each day with stacks of homework instead. My mother eventually homeschooled me, and I thrived.
At thirteen I got my first computer — a cheap, unreliable laptop. Keeping it running was an education in itself: fixing things, cleaning off viruses and malware, learning the machine by rescuing it. Around then I got hold of three programming books — Let Us C, Ada as a Second Language, and Beginning C++ Game Development — famously unforgiving texts for a teenager teaching himself. By fifteen I was writing real software.
RockyBASIC and the first compilers
My first language project was a small compiler/interpreter called RockyBASIC, named after myself. Around the same period I built ASCII Zombies, a game written in pure C++ — a project I'm currently redesigning in ALB under the name Red Sector.
Then, in August 2014, everything stopped: our family home burned down, and there was basically nothing left — including the machine and the work on it. I was fourteen. RockyBASIC's development ended there.
The lost years (2014–2017)
For roughly a year and a half there was nothing to build on. We had lost nearly everything — living with little more than the clothes we had, eventually in a camper. I kept going anyway: experimenting with Commodore 64 and DOS — mostly on emulators, sometimes real hardware — and studying history, science, math, and programming/cybersecurity on my own.
Recovery came one machine at a time. A cheap thrift-store laptop came first — not very good, but a start. Then family friends gave me a workstation with a literal name label on it: an HP Z230 (16 GB RAM, Intel i5-4590), gifted so I could get back to schoolwork. It helped — I was far behind — but about three or four months later I drew up a roughly $300 budget build: a $15 case, a GTX 950, the workstation's parts, spare rigging — a real desktop with real power at last. (The Z230 was later reassembled and went back into service once I had more machines.)
The gap years produced small languages and tools of their own:
- Graefait — a Borland-style library providing a
graphics.hheader for 64-bit Windows, written to replace the DOS-era graphics lessons my school assignments assumed - nandlib — a NAND-logic language built in NASM, usable from C
- Keystone — an experimental language made of clever FASM macros; I wrote a text adventure in it, which is about as far as it went
Graefait and nandlib are planned to be hosted here for anyone who wants to download or use them.
The return (2017)
I had tried other BASIC-family languages before the fire — GLBasic, PureBasic — and liked them, but none met my exact requirements. In the rebuild years my C/C++ game engine — the one behind ASCII Zombies, Riverine Commando, Bitland Wars, Fractal Lands — evolved into an Ada-based engine, and it needed a quick way to script enemies and game logic. The small DSL I wrote for it was called AdaLog. That name — Ada plus logic — is where AdaLogic comes from.
By then I had squeezed everything I could out of SDL and Raylib. A solid engine API, more bindings, more wrappers — and in 2017 I came back to the language itself "with a fury," rewriting the entire compiler in Ada 2012.
The modern toolchain
By that point I had also mastered FASM (the flat assembler) after years of struggling with other assemblers — so the early ALB toolchain was built directly on FASM rather than on any existing infrastructure.
One deliberate constraint shaped everything: no conventional intermediate representation. No LLVM, no borrowed backend. The first three or so code-generation backends were written completely by hand. By the time they existed, AI-assisted development was on the rise, and development speed accelerated rapidly on top of that foundation.
Today the compiler has many backends — including FASM, FASM16, and C — and the SDK ships with thick and thin bindings across its targets.
Lineage — more than a BASIC
ALB sits in the BASIC family tree, but calling it "a BASIC dialect" undersells it. It's a multi-paradigm language assembled deliberately from six ancestors — each one contributed something specific, and the seams are visible if you know where to look.
- BASIC — the syntax. The readable surface:
PRINT,LET,FOR/NEXT, case-insensitive keywords, the covenant that a beginner's first program should look like English. - Prolog — the logic. The declarative, logic-and-flow-shaped thinking in the language's advanced features — rules and pattern-flavored constructs where they help.
- Ada — the spine. The deterministic, safety-oriented engineering style — and, of course, the
--comments. Ada's influence runs through the type system's strictness. - C — the doorway out. Foreign-function interfacing: ALB reaches into native libraries, ENABLE blocks embed real C, and nothing about the language walls you off from the metal's neighbors.
- Pascal — the structure.
BEGIN/ENDas the program's skeleton, disciplined declarations, structured blocks — the readable-rigor school of design. - FASM — and assemblers generally — the floor. The toolchain was born on FASM, the first backends were hand-written, and ALB keeps a deliberately low-level feel when you drive it that way — near-assembler control, reachable from a friendly syntax.
Design philosophy
ALB's surface is BASIC-flavored, but its decisions are deliberate:
--comments, borrowed from Ada — chosen simply because I like the clean style (classicREMis not ALB syntax).- Case-insensitive keywords —
PRINT,print, andPrintare the same word, as in classic BASIC. - A real static type system — sized integers (
U8–U64,I8–I64,S32), floats (F64/REAL,PURE/RATIONAL), vector/matrix types (FLOAT2,FLOAT4,MAT2–MAT4),BOOL,STRING,BINARY, and hardware-sizedHW8/HW16/HW32types. - 1-based arrays — index 0 is out of bounds, matching how newcomers count.
- An event-shaped program model —
ON TICKholds update logic andON PAINTholds drawing, so a beginner always knows exactly where code goes. No guessing which loop owns what. - Temporal variables —
HISTORYandTEMPORALdeclarations record a variable's values over time, enabling runtime debugging where you can reverse computation and step back through a program's history. PARALLELblocks — parallel arrays made ergonomic without losing speed.- Hand-written backends — the no-IR constraint keeps the whole pipeline understandable and self-owned.
Syntax tour
The tour below covers the shape of the language — the official handbook is the verified syntax sheet (the cheat sheet), Learn has guided lessons, the examples gallery has runnable demos, and the lexicon explains the terms.
Program skeleton
BEGIN
VERSION 0.0.0.1
CREATE_WINDOW "ALB APP", 960, 640
ON TICK
-- update logic
END ON
ON PAINT
-- draw logic
END ON
LISTEN
END
Every program starts with BEGIN. The optional VERSION tag stamps the source's own version. LISTEN starts the event loop; ON TICK and ON PAINT separate simulation from rendering.
Declarations
#MAX_ENTITIES = 64
LET score = 0
LET hp AS U16 = 100
LET name AS STRING = "ALB"
TYPE SmallHealth IS U16 RANGE 1 .. 255 TEMPORAL
LET px AS I32 HISTORY 16 = 140
LET declares variables, optionally with explicit types. TYPE creates constrained types — RANGE bounds and TEMPORAL/HISTORY make a value replayable. #NAME = value defines a constant.
Control flow
IF hp > 0 THEN
LET alive = TRUE
ELSE
LET alive = FALSE
END IF
WHILE hp > 0
LET hp = hp - 1
END WHILE
FOR i = 1 TO 10 THEN
PRINT i
END FOR
MATCH mode
0 => state = 1
ELSE => state = 99
END MATCH
Structured IF/ELSE, WHILE, FOR, and MATCH arms with =>. SELECT uses CASE. Keywords are case-insensitive throughout.
Functions, modules, files
FUNCTION Twice(x AS U32) AS U32
RETURN x + x
END FUNCTION
MODULE MathKit
BEGIN
FUNCTION Add2(x AS U32) AS U32
RETURN x + 2
END FUNCTION
END MODULE
IMPORT MathKit
.alb is a main file; .albi is an include file. Modules and namespaces are the real organization mechanism, though — the extensions are a convention, and an include can live in any file name you like.
Arrays and PARALLEL
STRICT cells[64] AS U16
LET cells[1] = 10
PARALLEL swarm[128]
x AS S32
y AS S32
hp AS U16
END PARALLEL
Arrays are 1-based and statically typed; PARALLEL declares structure-of-arrays-style records with the ergonomics of a struct and the layout of parallel columns.
Toolchain
ALB compiles through a master driver, alb.exe (currently 0.2.0), which routes a program to one of many managed backend compilers. I wrote the compiler by hand with no LLVM-style IR, and ALB can build anything C, FASM, or TypeScript can build — through thick and thin bindings.
alb native game.alb -t fasm --build --outdir build/game
alb web game.alb --build --target es2020
alb c64 demo.alb --build --outdir build/c64
Backends
Every backend has short aliases (ts, rs, hs, py, 6502…); alb list shows them all.
The three native -t targets inside albt.exe each have their own article: the ALB FASM backend (x86-64 PE64), the ALB FASM16 backend (16-bit real mode — .COM, MZ .EXE, even boot sectors), and the ALB C backend (portable C89 + a staged build kit). The web side has its own article too: the ALB TypeScript backend (albw — browser canvas, console, and audio in one emitted .ts), and the second assembly path is the ALB NASM backend (albnasm — same emitted dialect through a different assembler and a real linker).
| Command | Executable | What it targets |
|---|---|---|
native | albt.exe | Universal compiler: FASM, FASM16, C |
web | albw.exe | TypeScript, browser, and Node |
c64 | alb_65.exe | Commodore 64 / 6502 |
brainfuck | albf.exe | Brainfuck (ALBB) native emitter |
java | albj.exe | Java / FlatJVM |
dotnet | albn.exe | .NET / C# |
ada | alba.exe | Native Ada |
python | albp.exe | Python |
lua | albl.exe | Lua (SDL3 graphics) |
moon | albm.exe | MoonScript (SDL3 graphics) |
rust | albr.exe | Rust (rustc) |
haskell | albh.exe | Haskell / GHC (SDL3) |
odin | albo.exe | Odin (SDL3 graphics) |
nasm | albnasm.exe | NASM assembly (win64) |
godot | albgd.exe | Godot |
player | alb_player.exe | ALB program player |
agent | veronica_main.exe | Veronica coding agent |
prompt | alb_prompt.exe | Prompt and model utility |
Polyglot blocks
ALB programs can embed foreign-language modules inline — ENABLE blocks for C, Ada, ASM, Python, Java, C#, and TypeScript/JavaScript — in the entry file or in INCLUDE files. alb polyglot inspect|build|run compiles the modules and the ALB host together into one all-language program.
Packages, tools, doctoring
alb pkg— the package manager (alb-pkg.exe);alb pkg install corepulls lean, version-locked toolchain packsalb tool <name>— run a bundled dependency directly (GCC, dotnet, Node) — offline-friendlyalb doctor/alb deps— verify compilers and the version-locked dependency bundlealb compile --backend <name>,--verbose,--dry-run— routing control and inspection
Graphics RHI
--gfx=<backend> selects the alb_gfx rendering backend DLL at compile time: OpenGL, Vulkan, or Direct3D 6 through 12.
Includes
INCLUDE "local.albi" pulls a source-local file; INCLUDE <alb_gfx.albi> pulls a system/stdlib include from the SDK's stdlib/vendor/ directories.
The web IDE
The full toolchain — now Apache 2.0 open source — lives on GitHub and is distributed through alb-lang.com.
Licensing
Who it's for
Scientists, kids, teachers, hobbyists, game jams, and professionals — anything another language can build, ALB aims to build too. That was the whole point from the start: a language that treats a kindergartner's first PRINT and a professional's deadline as equally worth building for.
See also
On this wiki
- Main Page
- Wiki Help
- BASIC — the whole family tree ALB descends from
- History of Programming — ALB's place in the long arc
- Red Sector — the in-development ALB remake of ASCII Zombies
On this site
- Handbook — the verified syntax sheet; the cheat sheet
- Browser IDE — write and run ALB in your browser
- Learn — guided lessons
- Examples — runnable demos
- Lexicon — ALB terms and vocabulary
- ALB SCAN — static analysis for ALB programs
- Toolkit — utilities built in ALB
- Help — getting unstuck
- Forum — the community