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
> 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
8
>
9
-
> Your contributions, feedback, and issue reports are highly valued and will help shape TinyPascal into the ultimate 2D game framework for Delphi!
9
+
> Your contributions, feedback, and issue reports are highly valued and will help shape TinyPascal into the ultimate Pascal development platform!
10
10
11
11
# TinyPascal
12
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.
13
+
**TinyPascal** is a lightweight, embeddable Pascal virtual machine designed for rapid language development, educational use, and embedded scripting. Built in Delphi with a clean modular architecture, TinyPascal uses a modern, case-sensitivevariant of Pascal with UTF-8 strings and strong type safety.
14
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.
15
+
TinyPascal features a stack-based virtual machine that executes bytecode generated from Pascal source code. This VM-based approach enables rapid development of language features, reliable execution, and easy embedding in host applications without the complexity of native code generation.
16
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.
17
+
Inspired by the philosophy of simplicity and modularity, TinyPascal is designed to be small, fast, and highly extensible. Perfect for educational projects, embedded scripting, rapid prototyping, and language research.
18
18
19
19
## ✅ Key Features
20
20
21
-
-**Memory-first Compilation**
22
-
Compiles Pascal source directly to memory as a valid Win64 PE executable.
21
+
-**Virtual Machine Execution**
22
+
Stack-based VM with type-safe value operations and comprehensive error handling.
23
23
24
-
-**Direct Execution**
25
-
Supports executing compiled code in memory without writing to disk.
24
+
-**Bytecode Generation**
25
+
Compiles Pascal source to efficient bytecode with full disassembly support for debugging.
26
26
27
-
-**Delphi-Compatible Core**
28
-
Uses a modern, case-sensitive Pascal syntax with strong compatibility for Delphi features.
27
+
-**Rapid Development**
28
+
VM architecture enables quick addition of new language features without low-level complexity.
29
29
30
-
-**Unicode by Design**
31
-
All strings are UTF-8 internally, with runtime UTF-8 → UTF-16 conversion for Windows API compatibility.
30
+
-**Modern Pascal Syntax**
31
+
Clean, case-sensitive Pascal with strong type safety and Unicode support.
32
32
33
-
-**C ABI Interop**
34
-
Clean interoperation with C libraries via well-defined basic types.
33
+
-**UTF-8 by Design**
34
+
All strings are UTF-8 internally with seamless integration for text processing.
35
35
36
-
-**Self-contained Runtime**
37
-
Built-in x64 codegen and PE generation with no external toolchain required.
36
+
-**Educational Focus**
37
+
Perfect for learning compiler construction, language design, and virtual machine concepts.
38
+
39
+
-**Embeddable Runtime**
40
+
Self-contained VM with no external dependencies, ideal for embedding in applications.
38
41
39
42
## 🔧 Type System
40
43
41
-
TinyPascal supports the following core types:
44
+
TinyPascal supports a clean, modern type system:
42
45
43
46
-`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
+
-`UInt` → unsigned 64-bit integer
48
+
-`Float` → IEEE 754 double precision
49
+
-`String` → UTF-8 encodedstring with automatic memory management
47
50
-`PString` → null-terminated `PUTF8Char` for C interop
51
+
-`Boolean` → true/false values
52
+
53
+
## 🧱 VM Architecture
54
+
55
+
TinyPascal uses a sophisticated multi-layer architecture:
@@ -98,17 +160,18 @@ See the [LICENSE](https://github.com/tinyBigGAMES/TinyPascal?tab=BSD-3-Clause-1-
98
160
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
161
100
162
### 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.
0 commit comments