pascal 0.1.1

A Pascal compiler in rust implementation with MCP support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
# pascal-rs - A Modern Pascal Compiler in Rust

**pascal-rs** is a Pascal compiler written in Rust, featuring trait-based architecture, comprehensive testing, and clean code generation. It combines Rust's safety guarantees with Pascal's elegance, creating a modern platform for learning compiler construction and experimenting with language design.

---

## ✨ **Status**: Active Development | **Tests**: 169/169 Passing | **Language**: Core Pascal Complete

**Note**: pascal-rs is ideal for education, research, and small projects. For production use with large codebases, consider mature compilers like Free Pascal or Delphi.

---

## 🎯 Why pascal-rs?

### The Problem with Traditional Pascal Compilers

Traditional Pascal compilers suffer from several issues:
- **Aging codebases** - Difficult to maintain and extend with modern features
- **Limited test coverage** - Insufficient validation of edge cases

### The pascal-rs Solution

**pascal-rs** addresses these problems with a modern, Rust-based architecture:

#### 1. **Memory Safety by Design**
```rust
// Rust's ownership model prevents:
// - Null pointer dereferences βœ…
// - Buffer overflows βœ…
// - Data races βœ…
// - Memory leaks βœ…
```

#### 2. **Trait-Based Architecture**
- **Clean abstractions** through Rust's trait system
- **Dependency inversion** - depend on traits, not concrete implementations
- **Easy testing** with mock implementations
- **Extensible design** for new features

#### 3. **Comprehensive Testing** (169 tests)
- Unit tests for all components
- Integration tests for end-to-end validation
- Complex validation tests for edge cases
- Performance benchmarks
- **100% test pass rate** βœ…

#### 4. **Modern Developer Experience**
- Clear, colored error messages with source locations
- Fast compilation with incremental builds
- Excellent IDE support via Rust tooling
- Comprehensive documentation

#### 5. **Optimizations**
- Constant folding and dead code elimination
- Register allocation with graph coloring
- Common subexpression elimination
- Function inlining and loop unrolling
- SIMD vectorization support

---

## πŸ“Š Comparison with Other Pascal Compilers

### Feature Comparison Table

| Feature | pascal-rs | Free Pascal (FPC) | Delphi | GNU Pascal (GPC) |
|---------|----------|------------------|--------|------------------|
| **Language** | βœ… | βœ… | βœ… | βœ… |
| **Memory Safety** | βœ… Rust guaranteed | C++ implementation | C++ implementation | C implementation |
| **Test Coverage** | βœ… 169 tests | ⚠️ Limited | ⚠️ Limited | ❌ Minimal |
| **Trait-Based Design** | βœ… Yes | ❌ No | ❌ No | ❌ No |
| **Interpreter Mode** | βœ… Built-in | ⚠️ Limited | ❌ No | ❌ No |
| **x86-64 Code Gen** | βœ… Optimized | βœ… Mature | βœ… Mature | βœ… Basic |
| **Active Development** | βœ… Yes | βœ… Yes | βœ… Yes | ❌ No (2006) |
| **Cross-Platform** | βœ… Yes | βœ… Yes | ⚠️ Windows only | βœ… Yes |
| **Compilation Speed** | βœ… Fast | ⚠️ Moderate | ⚠️ Moderate | ⚠️ Slow |
| **Error Messages** | βœ… Modern, colored | ⚠️ Basic | βœ… Good | ⚠️ Basic |

### Unique Advantages

**1. Memory Safety**
- Rust's ownership model prevents buffer overflows, null pointers, and data races
- Traditional C/C++ implementations vulnerable to these issues

**2. Trait-Based Architecture**
```rust
// Easy to test, easy to extend
trait ScopeOperations {
    fn get(&self, name: &str) -> Option<Value>;
    fn set(&mut self, name: &str, value: Value);
}
```

**3. Comprehensive Testing**
- 169 tests, 100% pass rate
- Edge cases validated
- Complex scenarios covered

**4. Modern Build System**
```bash
# Simple and fast
cargo build --release
cargo test
cargo run --bin pascal -- compile program.pas
```

**5. Interpreter Mode**
```bash
# Run directly without assembly/linking
pascal run program.pas
```

---

## πŸš€ Quick Start

### Installation

```bash
# Clone the repository
git clone https://github.com/yingkitw/pascal-rs.git
cd pascal-rs

# Build the compiler
cargo build --release

# The binary is now available at ./target/release/pascal
```

### Your First Pascal Program

Create `hello.pas`:
```pascal
program Hello;
begin
  writeln('Hello, World!');
end.
```

Compile and run:
```bash
# Compile with assembly output
pascal compile hello.pas -S

# Run using the interpreter
pascal run hello.pas

# View generated assembly
cat hello.s
```

**Output:**
```
Hello, World!
```

---

## πŸ“– Usage Guide

### Basic Compilation

```bash
# Compile a Pascal program
pascal compile program.pas

# Compile with optimization
pascal compile program.pas -O2

# Compile with verbose output
pascal compile program.pas -v

# Compile with assembly output
pascal compile program.pas -S

# Compile to specific directory
pascal compile program.pas -o ./build
```

### Running Programs

```bash
# Run using interpreter
pascal run program.pas

# Run with verbose output
pascal run program.pas -v

# Run with debug information
pascal run program.pas -d
```

### Working with Units

```bash
# Compile a unit (generates .ppu file)
pascal compile MathUtils.pas -v

# Inspect a compiled unit
pascal info mathutils.ppu

# Compile a program that uses the unit
pascal compile Calculator.pas -v
```

### Command Reference

| Command | Description | Example |
|---------|-------------|---------|
| `compile` | Compile Pascal source | `pascal compile prog.pas` |
| `run` | Run with interpreter | `pascal run prog.pas` |
| `info` | Show PPU file info | `pascal info module.ppu` |
| `clean` | Remove build artifacts | `pascal clean` |

### Options

| Option | Description |
|--------|-------------|
| `-o, --output <DIR>` | Output directory |
| `-O, --optimize <LEVEL>` | Optimization level (0-3) |
| `-v, --verbose` | Verbose output |
| `-S, --assembly` | Generate assembly output |
| `-d, --debug` | Debug information |
| `-I, --include <DIR>` | Add search path |
| `--no-cache` | Disable caching |

---

## πŸ’‘ Examples

### Example 1: Variables and Arithmetic

```pascal
program Arithmetic;
var
  a, b, c, d: integer;
  result: real;
begin
  a := 10;
  b := 5;
  c := 3;
  d := 2;

  // Complex expression: 10 + 5 * 3 - 2 / 2
  result := a + b * c - d div d;

  writeln('Result: ', result);  // Output: 24.0
end.
```

### Example 2: Control Structures

```pascal
program ControlStructures;
var
  i, sum, product: integer;
  flag: boolean;
begin
  sum := 0;
  product := 1;
  flag := false;

  // For loop with sum of squares
  for i := 1 to 5 do
  begin
    sum := sum + i * i;
    if (i mod 2) = 0 then
      flag := true;
  end;

  // While loop
  i := 10;
  while i > 0 do
  begin
    product := product * (i mod 3 + 1);
    i := i - 1;
  end;

  writeln('Sum: ', sum);
  writeln('Product: ', product);
  writeln('Flag: ', flag);
end.
```

### Example 3: Arrays and Records

```pascal
program DataStructures;
type
  Person = record
    name: string;
    age: integer;
    salary: real;
  end;

var
  people: array[1..3] of Person;
  i: integer;
begin
  // Initialize records
  people[1].name := 'Alice';
  people[1].age := 30;
  people[1].salary := 50000.00;

  people[2].name := 'Bob';
  people[2].age := 25;
  people[2].salary := 45000.00;

  people[3].name := 'Charlie';
  people[3].age := 35;
  people[3].salary := 60000.00;

  // Display information
  for i := 1 to 3 do
  begin
    writeln('Name: ', people[i].name);
    writeln('Age: ', people[i].age);
    writeln('Salary: ', people[i].salary);
    writeln('---');
  end;
end.
```

### Example 4: Boolean Logic

```pascal
program BooleanLogic;
var
  a, b, c, d, result: boolean;
begin
  a := true;
  b := false;
  c := true;
  d := false;

  // Complex boolean expressions
  result := (a and c) or (not b and not d);
  writeln('(true AND true) OR (NOT false AND NOT false) = ', result);

  result := (a and b) or (c and d);
  writeln('(true AND false) OR (true AND false) = ', result);

  result := not ((a and b) or (c and d));
  writeln('NOT ((true AND false) OR (true AND false)) = ', result);
end.
```

### Example 5: Functions and Procedures

```pascal
program Functions;

function Factorial(n: integer): integer;
begin
  if n <= 1 then
    Factorial := 1
  else
    Factorial := n * Factorial(n - 1);
end;

procedure PrintTriangle(rows: integer);
var
  i, j: integer;
begin
  for i := 1 to rows do
  begin
    for j := 1 to i do
      write('*');
    writeln;
  end;
end;

var
  n: integer;
begin
  n := 5;
  writeln('Factorial of ', n, ' is ', Factorial(n));
  writeln;
  writeln('Triangle:');
  PrintTriangle(5);
end.
```

### Example 6: Real-World Calculator

```pascal
program Calculator;
var
  num1, num2, result: real;
  operation: char;
begin
  writeln('=== Simple Calculator ===');
  writeln('Enter first number: ');
  readln(num1);
  writeln('Enter operation (+, -, *, /): ');
  readln(operation);
  writeln('Enter second number: ');
  readln(num2);

  case operation of
    '+': result := num1 + num2;
    '-': result := num1 - num2;
    '*': result := num1 * num2;
    '/': result := num1 / num2;
  else
    writeln('Invalid operation!');
    exit;
  end;

  writeln('Result: ', result);
end.
```

### Example 7: Unit System

**Create a unit** (`MathUtils.pas`):
```pascal
unit MathUtils;

interface

function Add(a, b: integer): integer;
function Multiply(a, b: integer): integer;
function IsEven(n: integer): boolean;

implementation

function Add(a, b: integer): integer;
begin
  Add := a + b;
end;

function Multiply(a, b: integer): integer;
begin
  Multiply := a * b;
end;

function IsEven(n: integer): boolean;
begin
  IsEven := (n mod 2) = 0;
end;

end.
```

**Compile the unit**:
```bash
pascal compile MathUtils.pas -v
```

**Use the unit** (`Calculator.pas`):
```pascal
program Calculator;

uses MathUtils;

var
  x, y: integer;
begin
  x := 10;
  y := 5;

  writeln('Addition: ', Add(x, y));
  writeln('Multiplication: ', Multiply(x, y));
  writeln('Is Even (10): ', IsEven(x));
  writeln('Is Even (5): ', IsEven(y));
end.
```

---

## πŸ—οΈ Latest Capabilities

### βœ… **Trait-Based Architecture**

Our modern trait-based design provides:

#### Core Traits
- **`TryAs<T>`** - Type-safe conversions with error handling
- **`FormattedDisplay`** - Configurable output formatting
- **`ScopeOperations`** - Variable storage abstraction
- **`FunctionRegistry`** - Function management interface
- **`StatementExecutor`** - Pluggable execution strategies
- **`ExpressionEvaluator`** - Custom evaluation strategies

#### Benefits
```rust
// Before: Tightly coupled code
fn execute(interpreter: &mut Interpreter) { ... }

// After: Trait-based, testable code
fn execute<T: ScopeOperations>(scope: &mut T) { ... }
```

**Benefits:**
- βœ… Easy mocking for testing
- βœ… Multiple implementations possible
- βœ… Clear separation of concerns
- βœ… Better maintainability

See [`TRAIT_ARCHITECTURE.md`](TRAIT_ARCHITECTURE.md) for details.

### βœ… **Comprehensive Testing** (169 Tests)

```
Library tests:        87 βœ…
Basic tests:          1 βœ…
Compiler tests:      10 βœ…
Complex validation:   9 βœ… NEW!
Integration tests:   10 βœ…
Interpreter tests:   11 βœ…
Simple compiler:     18 βœ…
Simple interpreter:  13 βœ…
Type checker:        10 βœ…
────────────────────────────
Total:             169 βœ…
```

#### Test Categories

**1. Complex Validation Tests** (NEW!)
- βœ… Complex arithmetic with operator precedence
- βœ… Nested control structures (5 levels deep)
- βœ… Character operations and comparisons
- βœ… Complex boolean expressions (AND, OR, NOT)
- βœ… Real number arithmetic
- βœ… Boundary conditions (zero, positive, negative)
- βœ… Comprehensive programs combining all features

**2. Integration Tests**
- βœ… Hello World
- βœ… Factorial calculation
- βœ… Fibonacci sequence
- βœ… Prime number generation
- βœ… Nested loops
- βœ… Record operations
- βœ… Array operations
- βœ… Case statements
- βœ… Repeat until loops
- βœ… String operations

**3. Compiler Tests**
- βœ… Simple program compilation
- βœ… Arithmetic operations
- βœ… Control structures
- βœ… Variable declarations
- βœ… Type declarations
- βœ… Arrays and records
- βœ… Case statements
- βœ… Repeat until loops
- βœ… String operations

See [`COMPLEX_VALIDATION_SUMMARY.md`](COMPLEX_VALIDATION_SUMMARY.md) for full details.

### βœ… **Advanced Interpreter Features**

**Built-in Functions** (20+):
- `abs`, `sqr`, `sqrt`, `sin`, `cos`, `ln`, `exp`
- `round`, `trunc`, `ord`, `chr`
- `length`, `pos`, `concat`, `copy`, `upcase`, `lowercase`
- `odd`, `succ`, `pred`, `random`
- `inttostr`, `strtoint`

**Built-in Procedures**:
- `write`, `writeln`, `readln`
- `inc`, `dec`, `halt`

**Control Flow**:
- βœ… if/else statements
- βœ… while loops
- βœ… for loops (to/downto)
- βœ… repeat until loops
- βœ… case statements
- βœ… begin/end blocks

### βœ… **Code Generation**

**x86-64 Assembly** (Intel syntax):
- Register allocation with graph coloring
- Stack-based variable management
- Proper function prologue/epilogue
- Multiple calling conventions (System V, Win64)

**Optimizations**:
- Constant folding
- Dead code elimination
- Common subexpression elimination
- Function inlining
- Loop unrolling
- Peephole optimization

### βœ… **Language Support**

**Data Types:**
- βœ… Integer (signed 64-bit)
- βœ… Real (IEEE 754 double precision)
- βœ… Boolean
- βœ… Char
- βœ… String
- βœ… Arrays (multi-dimensional)
- βœ… Records
- βœ… Pointers
- βœ… Enumerations
- βœ… Sets

**Operators:**
- βœ… Arithmetic: `+`, `-`, `*`, `/`, `div`, `mod`
- βœ… Comparison: `=`, `<>`, `<`, `<=`, `>`, `>=`
- βœ… Logical: `and`, `or`, `not`
- βœ… Bitwise: `&`, `|`, `xor`, `<<`, `>>`
- βœ… Unary: `+`, `-`, `not`

**Control Structures:**
- βœ… if/else
- βœ… while/do
- βœ… for/to/downto
- βœ… repeat/until
- βœ… case/of
- βœ… begin/end blocks

### ⚠️ **Current Limitations**

While pascal-rs successfully compiles and interprets core Pascal programs, there are features not yet implemented:

**Not Yet Implemented:**
- ❌ Object Pascal (classes, inheritance, polymorphism)
- ❌ Exception handling (try-except-finally)
- ❌ Generics/templates
- ❌ File I/O operations
- ❌ Dynamic arrays
- ❌ Variant records
- ❌ Operator overloading
- ❌ Properties
- ❌ Interfaces
- ❌ Advanced standard library (only basic built-ins)

**Platform Support:**
- βœ… x86-64 (primary target, well-tested)
- 🚧 ARM, RISC-V, MIPS, PowerPC (planned)
- 🚧 WebAssembly (planned)

**For these features, consider using Free Pascal or Delphi.**

---

## πŸ§ͺ Testing

### Running Tests

```bash
# Run all tests
cargo test

# Run specific test categories
cargo test --lib                          # Library tests (87)
cargo test --test run_compiler_tests      # Compiler tests (10)
cargo test --test run_integration_tests   # Integration tests (10)
cargo test --test run_complex_validation_tests  # Complex validation (9)
cargo test --test run_interpreter_tests   # Interpreter tests (11)
cargo test --test run_type_checker_tests  # Type checker tests (10)

# Run with output
cargo test -- --nocapture  # Show test output
cargo test -- --verbose    # Verbose test output
```

### Test Results

```
running 169 tests
test result: ok. 169 passed; 0 failed; 0 ignored; 0 measured
```

**All tests passing!** βœ…

### Test Coverage

- **Lexical Analysis**: Complete token coverage
- **Parsing**: All AST node types
- **Type Checking**: All type combinations
- **Code Generation**: All statement types
- **Interpreter**: All language features
- **Edge Cases**: Boundary conditions validated

---

## πŸ“š Architecture

### Modular Design

```
pascal-rs/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lexer.rs              # Lexical analysis
β”‚   β”œβ”€β”€ parser/               # Syntax analysis
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ expression.rs
β”‚   β”‚   β”œβ”€β”€ statement.rs
β”‚   β”‚   └── decl.rs
β”‚   β”œβ”€β”€ interpreter.rs        # Tree-walking interpreter
β”‚   β”œβ”€β”€ interpreter_value.rs  # Value type
β”‚   β”œβ”€β”€ interpreter_scope.rs  # Scope management
β”‚   β”œβ”€β”€ interpreter_function.rs # Function registry
β”‚   β”œβ”€β”€ interpreter_traits.rs # Trait abstractions
β”‚   β”œβ”€β”€ type_checker.rs       # Type validation
β”‚   β”œβ”€β”€ optimizer.rs          # Optimization passes
β”‚   β”œβ”€β”€ unit_codegen.rs       # Code generation
β”‚   └── resolver.rs           # Symbol resolution
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ run_compiler_tests.rs         # Compiler validation
β”‚   β”œβ”€β”€ run_integration_tests.rs      # End-to-end tests
β”‚   β”œβ”€β”€ run_complex_validation_tests.rs # Complex scenarios (NEW!)
β”‚   └── integration/
β”‚       └── complex_validation_tests.rs
└── examples/                      # Example programs
```

### Trait-Based Components

```rust
// Value operations
impl TryAs<i64> for Value
impl TryAs<f64> for Value
impl TryAs<bool> for Value
impl FormattedDisplay for Value

// Scope management
impl ScopeOperations for Scope
impl ScopeOperations for ScopeStack

// Function registry
impl FunctionRegistry for FunctionRegistryImpl
impl FunctionRegistry for HashMap<String, UserFunction>
```

### Compilation Pipeline

```
Source Code β†’ Lexer β†’ Tokens β†’ Parser β†’ AST
                                           ↓
                                    Type Checker
                                           ↓
                                    Optimizer
                                           ↓
                                  Code Generator
                                           ↓
                                     Assembly
```

---

## πŸ“– Documentation

- **[ARCHITECTURE.md]ARCHITECTURE.md** - Detailed architecture and design
- **[TRAIT_ARCHITECTURE.md]TRAIT_ARCHITECTURE.md** - Trait-based design guide
- **[COMPLEX_VALIDATION_SUMMARY.md]COMPLEX_VALIDATION_SUMMARY.md** - Test validation report
- **[TESTING.md]TESTING.md** - Testing guide and best practices
- **[TEST_STATUS.md]TEST_STATUS.md** - Test status and coverage
- **[TODO.md]TODO.md** - Development roadmap

---

## πŸ†• What's New

### Latest Release Highlights

**βœ… Trait-Based Architecture** (NEW!)
- Added comprehensive trait abstractions
- Improved testability and maintainability
- Better separation of concerns
- See [`TRAIT_ARCHITECTURE.md`]TRAIT_ARCHITECTURE.md

**βœ… Complex Validation Tests** (NEW!)
- 9 new comprehensive tests
- Edge cases and boundary conditions
- Complex operator precedence
- Nested control structures
- 100% pass rate

**βœ… Enhanced Testing Support**
- Added `current_scope()` method for testing
- Added `get_variable_value()` for value inspection
- Made `Scope` struct public with `get()` method

**βœ… Improved Documentation**
- Trait architecture guide
- Test validation summary
- Comprehensive examples
- Better inline documentation

---

## 🎯 Use Cases

### 1. **Education**
- Learn compiler construction with clean, modern code
- Understand trait-based design patterns
- Study optimization techniques
- Explore language implementation

### 2. **Research & Experimentation** βœ… Perfect Fit
- Test new optimization algorithms
- Experiment with trait-based architectures
- Benchmark compilation strategies
- Prototype language features
- Study type systems
- Research memory-safe compiler design

### 3. **Small Projects** βœ… Suitable
- Command-line utilities
- Scripts and automation
- Learning exercises
- Algorithm implementation
- Data processing tasks
- Homework assignments

### 4. **Legacy Modernization** ⚠️ Consider Limitations
- Works for standard Pascal code
- Missing Object Pascal features (classes, exceptions)
- Good for simple procedural Pascal programs
- May need modifications for advanced features

### Not Recommended For (Yet):
- ❌ Large commercial applications (use Free Pascal or Delphi)
- ❌ Complex GUI applications (no framework support yet)
- ❌ Database-heavy applications (limited database library support)
- ❌ Embedded systems (limited platform support)
- ❌ Projects requiring Object Pascal classes/exceptions

---

## πŸ™ Acknowledgments

- Inspired by the Free Pascal Compiler (FPC)
- Built with Rust and Cargo
- Uses modern compiler construction techniques
- Benefits from the Rust community's expertise

---

**Made with ❀️ in Rust**

*Status: Active Development | Tests: 169/169 Passing | Language: Core Pascal Complete*