14 ms·
Turbo Pascal Internals
- jonjacky 6y agoNo comments -- !? This is a remarkable project! The author reverse-engineered the original Turbo Pascal compiler, which was written in assembly, and wrote an equivalent compiler in Turbo Pascal itself! He writes: "I am a big fan of Pascal. Pascal programming language is easy to write and easy to read. I was impressed by the compilation speed of Borland Pascal and was wondering how it works. On the other hand I was interested in compiler theory so I started studying compiler construction books. At some point I decided to create a compatible compiler – Turbo Pascal compiler written in Turbo Pascal. The goal was to create a compiler that would use the same algorithms and data structures as the original compiler. The compiler would then compile programs with Borland syntax and would generate the same code. ... After some time I managed to create a complete compiler that reveals Turbo Pascal internals and shows all the beauty of the legendary Borland compiler. ... ... The beauty of Pascal programming language is that it is easy to read and needs little comments. All the constant, variables, procedures and functions have meaningful names so the algorithms are easy to read and understand. Of course, this is not the original source code of the compiler since it was not written in Pascal, but the code of a compatible compiler written in Turbo Pascal. You will be able to see the internal functions, data structures, algorithms, tips and tricks used by the compiler. Even if Pascal is not your language of choice you can easily understand the algorithms and approaches used by Borland software engineers in early 1990s."