I love Pascal and have been using it for decades, but... one of the biggest faults is the 1-pass compiler.
I get really annoyed at having to move the definition of procedures & functions round in a program, when I would prefer to have related procedures/functions near each other.
Please can you implement a 2-pass compile option? I don't think it would have a big impact on the language.
The whole parser is geared towards the single pass approach. Implementing a 2-pass approach would be a huge undertaking, one in which we have
no interest in. Not to mention that there are legal mechanisms that you can use:
If you use units and have your functions declared in the
interface-section the order won't matter in the
implementation-section (except if you want inlining between them, then they need to be ordered correctly). Not to mention the use of
forward for
implementation only functions (which is also the case for the main program).