Skip to content

About

Full BASIC (ISO 10279, with ECMA-116 graphics) and an IDE in your browser: write, run and share small games.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Arcade BASIC

CI Release .NET Spec: ISO 10279 License: MIT

Full BASIC — the ISO/ANSI standard, with its graphics module — for making small games and programs, in an IDE that runs in your browser. Write it, run it, debug it, and share a link that opens straight into your game.

▶ Open the IDE — nothing to install

The Arcade BASIC IDE in a browser, running a first-person 3D maze written in BASIC
  • An IDE in the browser: an editor that checks your program as you type, a debugger, a pixel editor for sprites and textures, a tune editor for PLAY, sound, and six themes.
  • A standard language: ISO/IEC 10279 Full BASIC — SUBs and FUNCTIONs, modules, SELECT CASE, exceptions, matrices, exact decimal arithmetic — with the ANSI graphics module and a few Microsoft BASIC favourites (INKEY$, SOUND, PLAY) for games.
  • Share and ship: a link that opens your program to edit or to play, a single native executable, or a desktop app.

Play

Every picture opens its game in the IDE, ready to play (code opens its program in the editor). They're all in examples/, written in Arcade BASIC.

Walking down a corridor in the first-person 3D maze
Maze 3D · code
Invaders: rows of aliens above the player's ship
Invaders · code
Breakout: coloured bricks, a ball and a paddle
Breakout · code
Tetris: a stack of falling blocks
Tetris · code
A kanban board with To Do, Doing and Done lanes
Kanban · code
Ready Edit, a text editor with tabs, written in BASIC
Ready Edit · code

Also there: Snake, Super Star Trek (1978), Lunar Lander (1969), a Mandelbrot set, a music demo and more — see examples/README.md.

The IDE

Pick an example or start a new program, press Run (F5), and click the screen so it gets your keys. Your programs stay in the browser between visits, and you can open and save .bas files of your own. Nothing is sent anywhere.

The debugger paused on a breakpoint in Breakout's main loop, the variables beside the code The pixel editor open on a 16 × 16 stone texture kept in DATA lines
A debugger: breakpoints, stepping over, into and out, and every variable as it changes. A pixel editor for the sprites and textures a program keeps in DATA lines.
The tune editor: a piano roll and keyboard for a PLAY string A play link: Invaders on its own page, with Restart, Full screen and Sound
A tune editor for PLAY strings: a piano roll, and a keyboard to play notes in. Play links: File → Copy a link to play this program opens straight into it, no editor.
The IDE in its QBasic blue theme, showing Super Star Trek The IDE in its Commodore 64 theme, showing Lunar Lander
Six themes, QBasic blue among them… …and Commodore 64.

Also: problems underlined as you type, completion, go to definition, an outline and folding for long programs, programs in several files (LIBRARY), colour swatches and a palette, sound, and the files your programs write kept in the browser. The IDE's own guide is src/ArcadeBasic.Web/README.md.

The language

Arcade BASIC is ISO/IEC 10279 Full BASIC (ANSI X3.113-1987, ECMA-116): the structured BASIC of the 1980s standards — no line numbers needed — with the standard's graphics module. A ball that bounces round the screen:

! A ball that bounces off the edges. Press Q to stop.
SET WINDOW 0, 160, 0, 100            ! your own coordinates: 160 across, 100 up
LET X = 20
LET Y = 70
LET DX = 1.5
LET DY = -1
DO
  CLEAR
  CALL BALL(X, Y)
  IF X + DX < 3 OR X + DX > 157 THEN LET DX = -DX
  IF Y + DY < 3 OR Y + DY > 97 THEN LET DY = -DY
  LET X = X + DX
  LET Y = Y + DY
  SLEEP 0.02                         ! one frame
LOOP UNTIL INKEY$ = "q"

SUB BALL(X, Y)
  SET AREA COLOR 3
  GRAPH AREA: X - 3, Y - 3; X + 3, Y - 3; X + 3, Y + 3; X - 3, Y + 3
END SUB
END

▶ Run this in your browser

What's in it:

  • Structured programs: SUB, FUNCTION and DEF, MODULEs with PUBLIC and SHARE variables, programs in several files (LIBRARY), SELECT CASE, DO … LOOP, EXIT; GOTO, GOSUB and line numbers still work, so 1970s listings run too.
  • Numbers that add up: exact decimal arithmetic (0.1 + 0.2 is 0.3), or OPTION ARITHMETIC NATIVE for hardware speed; matrices with MAT (+, *, TRN, INV, …).
  • Exceptions: WHEN … USE, CAUSE EXCEPTION, RETRY, CONTINUE, named handlers.
  • Text and files: PRINT USING pictures, INPUT, READ/DATA, files on channels (OPEN #1: NAME "scores.txt"), exact-value INTERNAL records.
  • Graphics: the standard's SET WINDOW, GRAPH LINES/AREA/TEXT with clipping, and MAT GRAPH CELLS and SET COLOR MIX for pixels and a 256-colour palette; the mouse with GET MOUSE and LOCATE POINT.
  • For games: INKEY$ and KEYDOWN (held keys), SLEEP to pace a frame, and SOUND, BEEP and PLAY (Music Macro Language) — Microsoft BASIC's, marked as such in the docs.

The language reference has every keyword and function with an example; conformance lists where Arcade BASIC departs from the standard and what it adds.

Outside the browser

The same engine — compiled to bytecode, run on a VM — runs everywhere:

Command
Command line arcade-basic run foo.bas Runs a program in a terminal; its graphics are drawn with Braille and ANSI colours, its sound played, and the mouse works where the terminal reports it. --svg out.svg and --wav out.wav save them instead.
Native binary arcade-basic build foo.bas -o foo One self-contained executable for Linux, macOS or Windows; no .NET needed where it runs.
Desktop app arcade-basic build foo.bas --desktop Your program in a window of its own, as in the browser (a Mac .app, or a Windows or Linux executable). Needs the desktop player (desktop/player).
REPL arcade-basic repl Type a line, see it run; blocks (FOR, SUB, …) continue on the next line.
.NET BasicEngine.Run(source, out output) Embed it: the libraries target net10.0 and netstandard2.1.

arcade-basic for Linux, macOS (Intel and Apple Silicon) and Windows is attached to each release.

$ arcade-basic run examples/hello.bas
$ arcade-basic build examples/invaders.bas -o invaders && ./invaders
using ArcadeBasic;

BasicEngine.Run("PRINT 6 * 7", out var output);
Console.WriteLine(output);   //  42

Documentation

  • Language reference — every keyword and function, with examples. Start here to learn the language.
  • Conformance — where Arcade BASIC follows ISO 10279, where it departs, and its extensions.
  • Examples — the sample programs and what each one shows.
  • The IDE — what the browser IDE does, and how to build and serve it yourself.
  • Building from source — prerequisites, and publishing the CLI and standalone binaries per platform.
  • Standalone builds — how arcade-basic build turns a .bas into one executable, or a desktop app.
  • Architecture — the pipeline, project graph and key data structures.
  • Contributing — the build and test loop, and recipes for adding functions, statements and opcodes.
  • Changelog — what each release changed.

Build from source

Requires the .NET 10 SDK.

git clone https://github.com/3583Bytes/Arcade-BASIC.git arcade-basic
cd arcade-basic

dotnet build                                                    # debug build
dotnet test                                                     # all tests (about 800)
dotnet run --project src/ArcadeBasic.Cli -- run examples/hello.bas
dotnet run --project src/ArcadeBasic.Web -c Release             # the IDE, on localhost

# An AOT-compiled standalone CLI for this platform
dotnet publish src/ArcadeBasic.Cli -c Release -r osx-arm64 -o publish/cli

The pictures in this README come from the IDE itself: node tools/screenshots/shots.mjs takes them all again (it needs Node 22 or later and Firefox).

CLI reference

arcade-basic <command> [args]

  run <file>              compile to bytecode and run it on the VM (vm is the same)
  build <file> [-o out]   produce a self-contained native binary
    --desktop             ... or a desktop app: the program in a window (--player <arcade-player>)
  repl                    interactive Arcade BASIC session
  lex <file>              tokenize and print the token stream
  parse <file>            lex + parse, pretty-print the AST
  analyze <file>          lex + parse + sema, print symbol/DATA summary
  --version

How it's built

A compiler pipeline and a bytecode VM in one C# solution. Each box is its own assembly, so you can pull in only what you need:

   Source file
        │
        ▼
  Lexer ──► Parser ──► Sema ──► Compiler ──► Bytecode VM ──► output
                                                  │
                                                  ├──► the browser IDE (WebAssembly)
                                                  └──► self-extracting native binary
Project Purpose
ArcadeBasic.Core source files, positions, diagnostics
ArcadeBasic.Lexer tokenizer
ArcadeBasic.Parser recursive-descent parser → immutable AST
ArcadeBasic.Sema two-pass analyzer; symbol/scope resolution as a side table
ArcadeBasic.Runtime BigDecimal-backed values, builtins, picture-string formatter, channels
ArcadeBasic.Bytecode opcode enum, chunk format, serializer
ArcadeBasic.Compiler AST → bytecode lowering
ArcadeBasic.Vm stack-based bytecode VM, and BasicEngine (source in, program run)
ArcadeBasic.Cli command dispatcher + self-extracting AOT stub
ArcadeBasic.Web the browser IDE (WebAssembly, on the VM)
ArcadeBasic.Player the player for desktop apps: a compiled program on the VM, no IDE (WebAssembly)
desktop/player the desktop player: the player page in a native window (Tauri)

The full write-up is docs/architecture.md.

Why?

Because why not. For fun, mostly.

License

MIT © 2026 Adam.

About

Full BASIC (ISO 10279, with ECMA-116 graphics) and an IDE in your browser: write, run and share small games.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages