Think in Pascal. Compile to C++.
Open-source Pascal-to-C++ transpiler with Pascal semantic compatibility. Self-contained distribution with bundled Zig compiler and runtime.
Named after the 17th-century French polymath Blaise Pascal—mathematician, physicist, and inventor of one of the first mechanical calculators—and the programming language that bears his name. Like its namesakes, Blaise Pascal™ embodies clarity, elegance, and the marriage of theoretical beauty with practical innovation. We honor Pascal's legacy by keeping the Pascal language alive and thriving in the modern age.
A modern Pascal dialect compatible with Delphi where possible. Transpiles fundamental Pascal syntax with clean, predictable C++ output. Best thought of as its own flavor of Pascal optimized for C++ compilation.
Generates clean C++23 code with modern LLVM backend. Leverages spaceship operator, std::format, and std::println for optimal performance.
Dumb transpiler, smart runtime. Simple token mapping keeps the transpiler maintainable while a sophisticated runtime preserves exact Pascal semantics.
Everything included - Blaise transpiler, Zig compiler, and complete runtime library. Just unzip and go, no additional downloads needed.
Compile for Windows, Linux, and macOS from any platform using bundled Zig build system with consistent behavior everywhere.
All runtime code in bp namespace with fully-qualified names. Perfect isolation from external libraries like raylib, SDL, OpenGL.
Simple design, powerful results
Wrap everything that can be wrapped in the C++ runtime
Make the transpiler DUMB.
Make the runtime SMART.
All runtime lives in namespace bp { ... }
ALWAYS use fully-qualified names: bp::Integer, bp::WriteLn
NEVER use 'using namespace bp;'
.pas files
Parse
Token map
Generate
Compile
Execute
Write Pascal, get optimized C++
program Hello; var name: String; age: Integer; begin name := 'World'; age := 42; WriteLn('Hello, ', name, '!'); WriteLn('Age: ', age); end.
#include "runtime.h" void ProgramMain() { bp::String name; bp::Integer age; name = "World"; age = 42; bp::WriteLn("Hello, ", name, "!"); bp::WriteLn("Age: ", age); } int main() { ProgramMain(); return 0; }
Comprehensive Pascal language support
Self-contained distribution - just unzip and go!
Blaise Pascal is completely self-contained. No external dependencies needed!
# Download Blaise Pascal package from GitHub # Extract to any directory # Everything included: # - Blaise.exe (transpiler) # - Zig 0.15.2 compiler (in bin/res/zig/) # - Complete runtime library (in bin/res/runtime/)
Initialize a new Blaise Pascal project
# Create a new program project bin\Blaise.exe init MyProgram # Or create a library project bin\Blaise.exe init MyLib --template library
Edit the generated source file in src/main.pas
program MyProgram; begin WriteLn('Hello from Blaise Pascal!'); end.
Use simple commands to build and execute your program
# Navigate to your project directory cd MyProgram # Build the project (transpile + compile) ..\bin\Blaise.exe build # Run the compiled executable ..\bin\Blaise.exe run
Use the {$TARGET} compiler directive to target different platforms
// Target Linux 64-bit {$TARGET x86_64-linux} program MyProgram; begin WriteLn('Cross-platform!'); end. // Other target examples: // {$TARGET x86_64-windows} - Windows 64-bit // {$TARGET aarch64-macos} - macOS ARM64 // {$TARGET x86_64-linux} - Linux 64-bit // {$TARGET native} - Current platform (default)
Control build settings with compiler directives
// Optimization levels {$OPTIMIZATION Debug} // Debug build (default) {$OPTIMIZATION ReleaseFast} // Fast optimized build // Application type (Windows) {$APPTYPE GUI} // No console window {$APPTYPE CONSOLE} // Console application (default) // Link external libraries {$LINK raylib.lib} {$LIBRARY_PATH .\lib}