LKBEN11039: Why is a Pascal or Delphi compiler so incredibly fast in comparison with a C or C++ compiler?


Symptom

You are just wondering why this is a fact

Cause

none

Solution

The Pascal language (also called Delphi from time to time) has been designed or concipated to have a certain structure. This makes it possible to compile it in one pass. These kind of compilers are also called One-Pass-Compilers. The advantage is the speed of compilation. The compiler only has to read the input files once to generate the program, a C or C++ compiler has to go through the sources many times to find all the information it needs to generate the program.

The disadvantage of a One-Pass-Compiler is the possibility of optimisation. (although one might say that this is only academic) Another disadvantage of languages which can be compiled in one pass, is the flexibility of the structure. To make it possible to compile in one pass, the program need a certain structure resulting in less flexibility for the programmer. In the source the subroutines or functions have to be known before they can be called. As a result, the main program is at the end of a file.

Although you can say this is a disadvantage, some people call it an advantage. A Delpi or Pascal programmer needs less initial time to get to know a new program.

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!

About the Author

Author: Wim Peeters - Keskon GmbH & Co. KG

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience, including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.