| Crates.io | xbasic64 |
| lib.rs | xbasic64 |
| version | 1.0.0 |
| created_at | 2025-11-29 18:10:01.777945+00 |
| updated_at | 2025-11-29 18:10:01.777945+00 |
| description | A BASIC-to-x86_64 native code compiler targeting 1980s-era BASIC dialects |
| homepage | https://github.com/jgarzik/xbasic64 |
| repository | https://github.com/jgarzik/xbasic64 |
| max_upload_size | |
| id | 1957172 |
| size | 329,630 |
A BASIC-to-x86_64 native code compiler written in Rust.
xbasic64 compiles 1980s-era BASIC dialects (Tandy Color BASIC, GW-BASIC, QuickBASIC) directly to native x86-64 executables. No interpreter, no bytecode—just fast native binaries.
Why xbasic64?
cargo build --release
# Compile a BASIC program to executable
xbasic64 program.bas
# Specify output file
xbasic64 program.bas -o myprogram
# Emit assembly only (no linking)
xbasic64 -S program.bas
' Fibonacci sequence
A = 0
B = 1
FOR I = 1 TO 10
PRINT A
C = A + B
A = B
B = C
NEXT I
Save as fib.bas, compile with xbasic64 fib.bas, and run ./fib.
The compiler uses a three-stage pipeline:
Source → Lexer → Parser → Code Generator → Assembly → Executable
(tokens) (AST) (x86-64)
The runtime library provides I/O, string operations, and math functions as hand-written x86-64 assembly using libc for portability.
Key design choices:
as)cc) with libc