Modern Pascal • C Performance
Write elegant Object Pascal, compile to blazing-fast native code
- Introduction
- What Makes It Special
- How It Works
- Quick Example
- Why NitroPascal
- Features
- Getting Started
- Documentation
- Contributing
- License
- Acknowledgments
NitroPascal is a next-generation Pascal implementation that bridges the elegance of Pascal with the raw performance of C. By combining modern language features with low-level optimization capabilities, NitroPascal aims to deliver the best of both worlds: readable, maintainable code that doesn't sacrifice speed.
NitroPascal takes a revolutionary approach to achieving C-level performance: transpilation. Instead of interpreting or compiling directly to bytecode, NitroPascal transpiles modern Object Pascal code into highly optimized, idiomatic C++. This intermediate C++ representation is then compiled using Zig as a drop-in C++ compiler, with the entire build orchestrated through build.zig, unlocking:
- 🎯 Multi-Target Compilation: Generate native binaries for Windows, Linux, macOS, and beyond
- ⚡ Aggressive Optimization: Leverage decades of C++ compiler optimization research through Zig's LLVM backend
- 🔧 Unified Build System: Simple, powerful builds with Zig's build.zig
- 🌐 Cross-Platform Excellence: Write once in Pascal, deploy everywhere with native performance
- 🔗 Natural Interop: Generated C++ code interfaces seamlessly with existing C/C++ libraries
By standing on the shoulders of the C++ ecosystem while leveraging Zig's modern toolchain and preserving Pascal's elegance, NitroPascal delivers truly uncompromising performance without sacrificing developer productivity.
NitroPascal's compilation pipeline transforms your Pascal code through multiple stages for optimal performance:
┌─────────────────┐
│ Object Pascal │ Write clean, modern Pascal code
│ Source │
└────────┬────────┘
│
▼
┌─────────────────┐
│ NitroPascal │ Parse and analyze with DelphiAST
│ Transpiler │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Optimized C++ │ Generate idiomatic, optimized C++
│ Code │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Zig Compiler │ Compile with Zig (drop-in C++ compiler)
│ (LLVM Backend) │ Leverage LLVM optimizations
└────────┬────────┘
│
▼
┌─────────────────┐
│ Native Binary │ Lightning-fast executable
│ Multi-Platform │
└─────────────────┘
See how elegant Pascal code transforms into optimized C++:
Object Pascal Source | Generated C++ Code |
---|---|
program HelloWorld;
procedure Greet(const AName: string);
begin
WriteLn('Hello, ' + AName + '!');
end;
begin
Greet('NitroPascal');
end. |
// Optimized C++ output
#include <iostream>
#include <string>
void Greet(const std::string& name) {
std::cout << "Hello, "
<< name
<< "!\n";
}
int main() {
Greet("NitroPascal");
return 0;
} |
Pascal has always been celebrated for its clarity and strong typing, making it an excellent choice for teaching and building reliable software. However, performance-critical applications have traditionally gravitated toward C/C++. NitroPascal challenges this dichotomy by:
- Breaking the Performance Ceiling: Achieving C-level performance without abandoning Pascal's clarity
- Modern Language Features: Bringing contemporary programming paradigms to the Pascal ecosystem
- Zero-Cost Abstractions: High-level constructs that compile down to optimal machine code
- Developer Experience: Maintaining the readability and maintainability that made Pascal beloved
- 🎨 Clean, expressive syntax that doesn't compromise on power
- 📝 Modern Object Pascal with contemporary language features
- 🔒 Memory safety through strong typing without garbage collection overhead
- ⚡ C-level performance through advanced transpilation
- 🔥 Optimized runtime engineered for maximum speed
- 🎯 Zero-cost abstractions that compile to optimal machine code
- 🛠️ Modern tooling powered by Zig's build system
- 🌐 Cross-platform compilation for Windows, Linux, macOS, and more
- ⚙️ Low-level control when you need it, high-level abstractions when you don't
- 📦 Seamless C/C++ interop for leveraging existing ecosystems
- 🔗 Natural FFI through generated C++ code
- 🌍 Library ecosystem access to the vast C/C++ world
Download the latest release from the Releases page. All dependencies are bundled - no separate installations required!
Note: NitroPascal is currently under active development. Check the releases page for the latest version!
- Third-Party Libraries - Open source libraries used by NitroPascal
- Website - Official NitroPascal website
- API Reference (coming soon)
- Language Guide (coming soon)
We welcome contributions! NitroPascal is in active development and there are many ways to help:
- 🐛 Report bugs and issues
- 💡 Suggest new features
- 📖 Improve documentation
- 🔧 Submit pull requests
Please check our Contributing Guidelines (coming soon) for more details.
NitroPascal is licensed under the BSD-3-Clause License.
The BSD-3-Clause license is a permissive open-source license that provides you with:
- ✅ Commercial Use - Use NitroPascal in commercial projects without restrictions
- ✅ Modification - Modify the source code to fit your needs
- ✅ Distribution - Redistribute the software freely
- ✅ Private Use - Use NitroPascal in private/proprietary projects
- ✅ No Copyleft - No requirement to open-source your projects built with NitroPascal
This means you can use NitroPascal to build both open-source and proprietary applications without worrying about licensing conflicts. The only requirements are to include the copyright notice and disclaimer in distributions.
NitroPascal builds upon excellent open-source projects:
- DelphiAST - Pascal AST parser
- LLVM - Compiler infrastructure
- Zig - Programming language and toolchain
See THIRD-PARTY.md for complete attribution.
Currently Under Construction 🏗️
NitroPascal is in active development. Star the repo to stay updated!
Built with passion for performance and elegance ⚡
© 2025-present tinyBigGAMES™ LLC • All Rights Reserved