HN
Today

Blaise – A modern self-hosting zero-legacy Object Pascal compiler targeting QBE

Blaise revitalizes Object Pascal, shedding decades of legacy to offer a modern, self-hosting compiler focused on developer productivity and memory safety. This project aims to bring the classic language into the 2020s with a single, streamlined dialect and automatic reference counting. Its ambitious vision to eliminate complexity and target modern backends like QBE and LLVM makes it a compelling technical deep dive for the HN crowd.

17
Score
1
Comments
#5
Highest Rank
6h
on Front Page
First Seen
May 8, 6:00 AM
Last Seen
May 8, 11:00 AM
Rank Over Time
7512131419

The Lowdown

Blaise is a newly developed, self-hosting Object Pascal compiler that aims to modernize the language by completely shedding legacy baggage. It promises a clean, high-performance, and memory-safe development experience for Object Pascal, reimagined for contemporary computing environments.

  • Unified Language Design: Blaise embraces a single language mode and a single UTF-8 reference-counted string type, simplifying the language compared to multi-mode, multi-string-type predecessors like Free Pascal.
  • Automatic Memory Management: It implements Automatic Reference Counting (ARC) consistently across all types (strings, classes, interfaces), including [Weak] attributes to prevent reference cycles, eliminating the need for manual memory management or complex TObject/TInterfacedObject distinctions.
  • Modern Compiler Architecture: Features clean, GUID-less interfaces using compile-time vtable mapping, reified generics (monomorphization), and a custom build system (PasBuild) and debug format (OPDF) designed for modern workflows.
  • Targeting Modern Backends: The compiler currently targets QBE (Tiny Code Generator) and is actively developing an LLVM backend, allowing for efficient native code generation across platforms.
  • Status and Roadmap: Blaise is already self-hosting and built with extensive test-driven development. Core features like the type system, generics, and debug info emission are complete, with cross-platform support and IDE extensions planned.
  • Legacy Pruning: Key removals include various legacy string types, the 'with' statement (due to resolution bugs), old-style 'object' types, COM-style GUIDs, multiple language modes, and classic I/O functions, streamlining the language for clarity and maintainability.

By focusing on simplicity, modern paradigms, and shedding historical complexity, Blaise offers a compelling vision for a revitalized Object Pascal, potentially attracting both long-time Pascal enthusiasts and new developers seeking a productive, robust language.