You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://discord.gg/tPWjMwK)
3
+
[](https://bsky.app/profile/tinybiggames.com)
4
+
5
+
> 🚧 **This repository is currently under construction.**
6
+
>
7
+
> TinyPascal is actively being developed and rapidly evolving. Some features mentioned in this documentation may not yet be fully implemented, and both APIs and internal structure are subject to change as we continue to improve and expand the library.
8
+
>
9
+
> Your contributions, feedback, and issue reports are highly valued and will help shape TinyPascal into the ultimate 2D game framework for Delphi!
10
+
1
11
# TinyPascal
2
-
TinyPascal is a lightweight, embeddable Win64 Pascal compiler.
12
+
13
+
**TinyPascal** is a lightweight, embeddable Pascal compiler designed to compile Pascal source code directly into Win64 PE format in memory, with immediate execution support. It is built in Delphi, follows a modular architecture, and uses a case-sensitive, Unicode-aware variant of Pascal with UTF-8 strings and clean interop with the Windows API and C ABI.
14
+
15
+
TinyPascal generates x64 machine code without external dependencies, making it ideal for embedding and runtime code generation. It supports writing to memory and will also support .exe, .dll, and .lib output using the same backend.
16
+
17
+
Inspired by the design philosophy of TinyCC, TinyPascal is written in Delphi and designed to be small, fast, and modular. It generates x64 machine code directly, with no external dependencies, making it ideal for embedding in other applications or for use in runtime code generation scenarios.
18
+
19
+
## ✅ Key Features
20
+
21
+
-**Memory-first Compilation**
22
+
Compiles Pascal source directly to memory as a valid Win64 PE executable.
23
+
24
+
-**Direct Execution**
25
+
Supports executing compiled code in memory without writing to disk.
26
+
27
+
-**Delphi-Compatible Core**
28
+
Uses a modern, case-sensitive Pascal syntax with strong compatibility for Delphi features.
29
+
30
+
-**Unicode by Design**
31
+
All strings are UTF-8 internally, with runtime UTF-8 → UTF-16 conversion for Windows API compatibility.
32
+
33
+
-**C ABI Interop**
34
+
Clean interoperation with C libraries via well-defined basic types.
35
+
36
+
-**Self-contained Runtime**
37
+
Built-in x64 codegen and PE generation with no external toolchain required.
38
+
39
+
## 🔧 Type System
40
+
41
+
TinyPascal supports the following core types:
42
+
43
+
-`Int` → signed 64-bit integer
44
+
-`UInt` → unsigned 64-bit integer
45
+
-`Float` → IEEE 754 double
46
+
-`String` → UTF-8 encoded, ref-counted string
47
+
-`PString` → null-terminated `PUTF8Char` for C interop
48
+
49
+
## 🧱 Modular Architecture
50
+
51
+
TinyPascal is built using a clean modular design. Units follow a consistent naming convention:
52
+
53
+
-`TinyPascal.Lexer` — Lexical analyzer
54
+
-`TinyPascal.Parser` — Syntax parsing and AST generation
55
+
-`TinyPascal.CodeGen` — x64 code generation
56
+
-`TinyPascal.PE` — Win64 PE format emitter
57
+
-`TinyPascal.Runtime` — Core runtime helpers (e.g., UTF-8 to UTF-16 conversion)
58
+
-`TinyPascal.Compiler` — Entry point and orchestration
**TinyPascal** is distributed under the **BSD-3-Clause License**, allowing redistribution and modification in both source and binary forms.
94
+
See the [LICENSE](https://github.com/tinyBigGAMES/TinyPascal?tab=BSD-3-Clause-1-ov-file#BSD-3-Clause-1-ov-file) for details.
95
+
96
+
## 💖 Support & Sponsorship
97
+
98
+
Your support keeps **TinyPascal** evolving! If you find this library useful, please consider [sponsoring the project](https://github.com/sponsors/tinyBigGAMES). Every contribution helps drive future enhancements and innovations.
99
+
100
+
### Other ways to support:
101
+
- ⭐ **Star the repo** – Show your appreciation.
102
+
- 📢 **Share with your network** – Spread the word.
103
+
- 🐛 **Report bugs** – Help improve `TinyPascal`.
104
+
- 🔧 **Submit fixes** – Contribute by fixing issues.
105
+
- 💡 **Suggest features** – Help shape its future.
106
+
107
+
🚀 Every contribution makes a difference – thank you for being part of the journey!
108
+
109
+
---
110
+
111
+
**TinyPascal** — Pascal reborn for systems ⚙️, memory 🧠, and modern interop 🔗.
0 commit comments