Skip to content
HN On Hacker News ↗

GitHub - graemeg/blaise: A modern, self-hosting Object Pascal compiler built for the 2020s. Zero legacy, full ARC, and unified UTF-8.

▲ 107 points 55 comments by peter_d_sherman 2w ago HN discussion ↗

Pangram verdict · v3.3

We believe that this document is fully human-written

17 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 4 of 4
SEGMENTS · AI 0 of 4
WORD COUNT 739
PEAK AI % 28% · §2
Analyzed
May 8
backend: pangram/v3.3
Segments scanned
4 windows
avg 185 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 739 words · 4 segments analyzed

Human AI-generated
§1 Human · 18%

Folders and filesNameNameLast commit messageLast commit dateLatest commitHistory196 Commitscompilercompilerdocsdocspluginspluginsrtlrtlscriptsscriptsteststeststoolstoolsvendor/qbevendor/qbe.gitignore.gitignoreLICENSELICENSENOTICENOTICEREADME.adocREADME.adocproject.xmlproject.xmlREADMEApache-2.0 license The Pascal you love, reimagined for the modern era.Blaise is a next-generation Object Pascal compiler built from the ground up to eliminate decades of legacy baggage. It prioritizes developer productivity, memory safety, and high-performance execution. ✨ The VisionThe Object Pascal ecosystem has two options: Embarcadero Delphi (proprietary, Windows-first) and Free Pascal (open source but carrying 30 years of accumulated complexity — five language modes, five string types, and thousands of include files).This compiler takes a different approach:

One language mode. No {$mode} switches; no legacy dialect support.

One string type. UTF-8 reference-counted string. RawBytes for binary data.

One memory model. Automatic reference counting applies uniformly to strings, classes, and interfaces. No manual/auto split between TObject and TInterfacedObject; [Weak] breaks cycles. Free is retained as a synonym for immediate release.

Clean interfaces. No COM GUIDs; interface dispatch via compile-time vtable mapping.

Reified generics. Monomorphization at compile time — no type erasure.

Modern build system. PasBuild with project.xml; no makefiles.

First-class debugger. OPDF is the default debug format; DWARF is not required.

See docs/design.adoc for the full architecture and implementation plan.The result — A modern, cross-platform Object Pascal compiler targeting native code via QBE (and eventually LLVM). Single language mode, single string type, zero-GUID interfaces, reified generics, and first-class OPDF debug format support. 🚀 Project Status

Self-Hosting: Yes. Blaise currently bootstraps and recompiles itself with byte-for-byte exact matches.

Testing: 1200+ tests and growing (Test-Driven Development from day one).

Backends: Currently utilizing a QBE backend, with an LLVM backend in active development.

§2 Human · 28%

Phase Goal Status

1 Bootstrap pipeline — Hello World on Linux x86_64 via PasBuild Complete ✅

2 Type system — classes, records, ARC, exceptions Complete ✅

3 Generics + zero-GUID interfaces Complete ✅

4 OPDF debug info emission Complete ✅

5 Self-hosting + LLVM + Windows + macOS ARM64 In-Progress

6 LSP + VS Code extension Planned

7 Migration analyser for FPC/Delphi codebases Planned

What Is Dropped From Classic Pascal

Feature Reason for removal

ShortString, AnsiString, WideString, UnicodeString Replaced by a single UTF-8 reference-counted string type

with statement Source of hard-to-diagnose symbol resolution bugs; breaks static analysis

Old-style object types Use record (stack/value) or class (heap/reference) instead

COM-style interface GUIDs Interface dispatch via compile-time vtable; GUIDs are unnecessary complexity

Multiple language modes One dialect, maintained well, beats five dialects maintained poorly

assign, reset, rewrite, blockread Replaced by a stream-based I/O RTL

TObject vs TInterfacedObject split One unified class model under automatic reference counting; [Weak] breaks cycles

📢 CommunityThe core architecture is still being finalised, so the project is not yet accepting code contributions. Feedback on language design, syntax choices, and the future direction of Blaise is very welcome — please use the Discussions tab on GitHub. Repository LayoutThis project uses PasBuild’s multi-module layout.

§3 Human · 11%

Each subdirectory with a project.xml is an independent module; the root project.xml is the aggregator.project.xml Root aggregator (packaging=pom) │ ├── compiler/ The compiler binary (packaging=application) │ ├── project.xml │ └── src/ │ ├── main/pascal/ uLexer, uParser, uAST, uCodeGenQBE, ... │ └── test/pascal/ FPTest test suite for compiler units │ ├── rtl/ Runtime library (packaging=library) │ ├── project.xml │ └── src/ │ ├── main/pascal/ System.pas, SysUtils.pas, Classes.pas, ... │ └── test/pascal/ FPTest test suite for RTL units │ ├── tools/ │ └── migration-analyser/ FPC/Delphi migration report tool (packaging=application) │ ├── project.xml depends on compiler module │ └── src/ │ ├── main/pascal/ │ └── test/pascal/ │ ├── vendor/qbe/ Vendored QBE backend source (pinned, built from source) └── docs/ Design documents and specificationsPasBuild compiles each module to its own target/ subdirectory. Build output is never committed to the repository. BuildingPrerequisites

Free Pascal Compiler 3.2.2 or later (stable; 3.3.x development snapshots are not required)

PasBuild

A C compiler (gcc or clang) for building the vendored QBE backend

GNU ld or lld (Linux); ld (macOS)

Build all modulespasbuild compilePasBuild resolves the module dependency order automatically and compiles rtl → compiler → tools/migration-analyser.Build with a profilepasbuild compile -p debug # includes -g -gl -Criot -gh pasbuild compile -p release # includes -O2 -CX -XX -XsRun testspasbuild testBuild a single modulepasbuild compile -m blaise-compilerRunning the compilerOnce built, the compiler binary is at compiler/target/blaise.#

§4 Human · 1%

Compile a single file compiler/target/blaise --source Hello.pas --output Hello

# Compile via project.xml compiler/target/blaise --project project.xml --config debug --output myapp

# Emit QBE IR (useful for debugging the compiler itself) compiler/target/blaise --source Hello.pas --emit-ir LicenceApache License v2.0 with Runtime Library Exception. See LICENSE.Built with ❤️ for the Pascal community by Graeme.