2 ms·
This is a nice introduction. Apparently the author also implemented a full game engine in Object Pascal: https://github.com/castle-engine/castle-engine/ https:/
by Rochus 3y ago
This is a nice introduction. Apparently the author also implemented a full game engine in Object Pascal: https://github.com/castle-engine/castle-engine/ https://github.com/castle-engine/castle-engine/. I wonder whether the performance is sufficient; according to available benchmarks (e.g. the CLBG) the code generated by FreePascal is about three to four times slower than C/C++; does anyone have experience with it?
- pjmlp 3y agoFreePascal is a compiler, C and C++ are languages. When using polyglot compiler toolchains there is hardly a big difference. For example, nowadays Delphi uses LLVM as well. The code generated by it and C++ Builder are quite similar.
- Rochus 3y ago> FreePascal is a compiler, C and C++ are languages Thanks for this really helpful remark. FreePascal is a compiler and also a Pascal dialect (actually two, one with classes). All examples in the referenced document start with "{$mode objfpc}", i.e. the OO FreePascal dialect. The CLBG results are also from the FreePascal compiler, currently version 3.2.2 (compared with GCC 12.2). The question was whether the generated code is fast enough for the game engine. And yes, there is even an LLVM backend for FreePascal, but it's not the official one, only supports a fraction of the platforms, and the generated code apparently is not really much faster.