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


This article has not been checked!

LKB | Created: 02/04/2020 | Version: 0 | Language: EN | Rating: 0 | Outdated: False | Marked for deletion: False

Author: Wim Peeters - Keskon GmbH & Co. KG


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.

About the Author

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 in different European countries and different European languages. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform where he is one of the most important contributors and the main developer.

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!