Skip to content

Commit 0a38566

Browse files
committed
Compilers and FPC "syntax modes" section - to make it explicit we support both compilers
1 parent 5b2293f commit 0a38566

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

modern_pascal_introduction.adoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,22 @@ The rest of this article talks about the Object Pascal language, so don't expect
4949
Voila -- a working GUI application, cross-platform, with native look everywhere, using a comfortable visual component library. The Pascal compilers come with lots of standard units for networking, GUI, database, file formats (XML, json, images...), threading and everything else you may need. I already mentioned my cool _Castle Game Engine_ earlier:)
5050
// The libraries created in other languages (dll, so, dylib) can be easily used from FPC too (and for most of them, you'll find ready "header" units, and even units that wrap them in more modern object-oriented API).
5151

52+
### Compilers and FPC "syntax modes"
53+
54+
This book, all the text and Pascal examples, has been written to support two modern Pascal compilers:
55+
56+
1. _Free Pascal Compiler (FPC)_, open-source Pascal compiler, used also by the _Lazarus_ IDE.
57+
58+
2. _Delphi_, a proprietary Pascal compiler from Embarcadero.
59+
60+
In this book, we chose to support both compilers, fully. Just like in _Castle Game Engine_, we support them both, and it's your choice which one do you prefer. Our _continuous integration_ (see https://castle-engine.io/github_actions) makes sure all samples really compile with both compilers.
61+
62+
To complicate matters a bit, FPC compiler has multiple "syntax modes". In this book, we decided to show the _ObjFpc_ syntax mode, which is recommended by the FPC developers and is the default for new Pascal projects created using _Lazarus_ or _Castle Game Engine_. It's a bit different from the _Delphi_ syntax mode, which is most compatible with Pascal language as implemented by _Delphi_. We https://github.com/modern-pascal/modern-pascal-introduction/wiki/Some-differences-betwen-FPC-ObjFpc-mode-and-Delphi-(and-FPC-Delphi-mode)[wrote a detailed comparison here].
63+
64+
But you don't want to read about these differences now, if you're just starting to learn Pascal!
65+
66+
The differences are minor, both between compilers and between FPC _ObjFpc_ mode and _Delphi_ mode. Just be aware you may see some `{$ifdef FPC} ... {$endif}` clauses in the examples, that make the code valid for both FPC and Delphi. If your project targets only one of these compilers, you can simplify your code, just pick the variant for your compiler.
67+
5268
### Functions, procedures, primitive types
5369

5470
[source,pascal]

0 commit comments

Comments
 (0)