Who has the better compiler?

A true multi-language compiler. Written in OOP Pascal (self-hosting) with LLVM backend.
Making Pascal Binaries Smaller and even Faster!
Post Reply
ONiX
Site Admin
Posts: 185
Joined: Tue Nov 18, 2025 1:27 am

Who has the better compiler?

Post by ONiX »

Growing up in the Turbo Pascal days, and having built my own 100% backward compatible TP7 compiler.

* I personally struggle with the Bloat of newer compilers.

Test Case

Code: Select all

Begin
   Writeln('Who makes the smallest Linux EXE from Pascal?!');
End.
TP7: 3 lines, 0.1 seconds, 2496 bytes code, 670 bytes data.
EXE: -rw-r--r-- 1 ozz ozz 2672 Jul 4 12:38 TESTCASE.EXE
(*) Negative, requires DOS to run, but, 2.6kb!

FPC: Linking testcase
3 lines compiled, 0.3 sec
ELF EXE: -rwxr-xr-x 1 root root 191072 Jul 5 17:12 testcase
(*) Negative, it is 191.0kb!

MLC:
mlc "My Little Compiler" v1.0
[MLC] Compiling: testcase.pas
[MLC] Source: 73 bytes
[MLC] Tokens: 9
[MLC] AST: Generated
[MLC] Generated: LLVM IR
[MLC] Compiling...
[MLC] Assembly: testcase.s
[MLC] Object: testcase.o
[MLC] Binary: testcase
[MLC] Success!
real 0m0.731s

ELF EXE: -rwxr-xr-x 1 root root 16200 Jul 5 17:23 testcase
(*) Negative, it is 16.2kb!

If you cheat and use ``upx -9``
(*) Shrinks it down to ELF EXE: -rwxr-xr-x 1 root root 6352 Jul 5 17:23 testcase

Code: Select all

16200 ->      6352   39.21%   linux/amd64   testcase
ONiX
Site Admin
Posts: 185
Joined: Tue Nov 18, 2025 1:27 am

My Little Compiler - is better!

Post by ONiX »

Code: Select all

mlc "My Little Compiler" v1.0.1
[MLC] Compiling: testcase.pas
[MLC] Source: 73 bytes
[MLC] Tokens: 9
[MLC] AST: Generated
[MLC] Variables: 0 global, 0 local
[MLC] Generated: testcase.ll
[MLC] Compiling...
[MLC] Assembly: testcase.s
[MLC] Object: testcase.o
[MLC] Binary: testcase
3 lines, 0.5 seconds, 16200 bytes
Global: 0 bytes, Local: 0 bytes
Compresses to: 16200→2732(83.1%)
[MLC] Success!
Based upon LZSS, the compiler self-packs every binary it produces, and wraps in assembly to decompress into RAM at run-time!

Also, remember, TP produced this same DOS EXE at 2.6kb, and we are producing a 64bit ELF EXE at 2.7kb! * Enough?!
ONiX
Site Admin
Posts: 185
Joined: Tue Nov 18, 2025 1:27 am

Re: Who has the better compiler?

Post by ONiX »

※ recap: MLC is a production-ready OOP Pascal compiler with automatic LZSS binary compression at 82% ratio and full variable tracking.
Post Reply