Skip to content

valkyoth/elderheim

Rust-native compiler for legacy languages, starting with BASIC.
Multi-frontend by design. Cranelift-backed. Built for standalone release binaries.


elderheim overview

elderheim

elderheim is a universal compiler project for legacy languages. The intended release model is one downloadable compiler binary per supported operating system. A user downloads elderheim, chooses the source dialect explicitly, and compiles old source files without installing Rust, rustc, or Cargo.

The first stable goal is 1.0.0: a real BASIC compiler path implemented in Rust, using Cranelift for native code generation. Other legacy languages are planned as later frontend releases that lower into the same shared compiler pipeline.

elderheim is licensed under MIT OR Apache-2.0.

What Works Today

0.10.0 is a foundation release. It intentionally does not claim full BASIC or QuickBASIC compatibility yet.

Compiler Foundation

Capability Status Notes
Cargo workspace Working Split into AST, parsers, codegen, and CLI crates.
Shared AST Working Frontends lower into common language-neutral structures.
Dialect routing Working CLI accepts explicit dialect selection.
BASIC parser core Early Supports PRINT, LET, implicit assignment, GOTO, IF ... THEN GOTO, labels, line numbers, REM, and END.
Cranelift backend Early Emits a native object file for the smallest supported program shape.
Unsupported codegen rejection Working Unsupported statements fail closed instead of producing wrong binaries.
Release/security gates Working Formatting, clippy, tests, dependency policy, audit, SBOM, and reproducible-build scripts are present.

Language Support

Language or family Status Target
BASIC core In progress 1.0.0
Dartmouth BASIC, Tiny BASIC, Microsoft BASIC family Planned 1.x
QuickBASIC, QBasic, FreeBASIC, QB64, PowerBASIC Planned 1.x to 2.x
COMAL, Pascal, Logo, Forth, REXX Planned 3.x
Algol, Modula-2, Ada, Delphi/Object Pascal Planned 4.x
COBOL, Fortran, dBASE/Clipper/FoxPro, PL/M Planned 5.x

See the full Language Release Plan.

Why elderheim

  • Standalone compiler goal: released binaries should compile supported source files without requiring users to install Rust.
  • Rust first: memory-safe implementation with a pinned modern Rust toolchain.
  • Cranelift backend: native object-code generation through a Rust-native compiler backend.
  • Many frontends, one backend: each legacy dialect gets an isolated parser that lowers into the shared AST.
  • Security first: unsupported constructs fail explicitly, dependencies are audited, and releases require SBOM and reproducibility evidence.

Quick Start

Build the workspace:

cargo build --workspace

Check a BASIC source file:

cargo run -p elderheim -- --dialect basic --check examples/hello.bas

Print the parsed AST:

cargo run -p elderheim -- --dialect basic --emit ast examples/hello.bas

Emit a native object file for the currently supported minimal program shape:

cargo run -p elderheim -- --dialect basic examples/end.bas -o end.o

Run the normal local gate:

scripts/checks.sh

Workspace

elderheim/
├── crates/
│   ├── elderheim-ast/       # Shared language-neutral AST
│   ├── elderheim-parsers/   # Isolated frontends, one module per dialect
│   ├── elderheim-codegen/   # Cranelift backend
│   └── elderheim-cli/       # User-facing compiler binary
├── docs/
├── examples/
├── release-notes/
└── scripts/

Documentation

Document Purpose
Architecture Compiler pipeline, crate boundaries, and frontend/backend model.
Versioning Plan Stop points from 0.10.0 to 1.0.0.
Language Release Plan Planned language and dialect rollout after the BASIC target.
Roadmap Current and future language scope.
Release Checklist Required release validation and evidence.
Supply-Chain Security Dependency and tooling review policy.
Security Policy Security checks and reporting guidance.

Release Direction

The project does not aim to make one giant parser that guesses every old language. Users should choose the dialect explicitly:

elderheim --dialect basic program.bas -o program
elderheim --dialect quickbasic game.bas -o game
elderheim --dialect pascal app.pas -o app

Each frontend should live in its own Rust source file and lower into the same compiler AST. The backend should remain shared.

About

Universal compiler for legacy languages

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors