[HN Gopher] Modern Object Pascal Introduction for Programmers
       ___________________________________________________________________
        
       Modern Object Pascal Introduction for Programmers
        
       Author : andsoitis
       Score  : 10 points
       Date   : 2023-06-17 16:04 UTC (6 hours ago)
        
 (HTM) web link (castle-engine.io)
 (TXT) w3m dump (castle-engine.io)
        
       | Rochus wrote:
       | This is a nice introduction. Apparently the author also
       | implemented a full game engine in Object Pascal:
       | 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 wrote:
         | FreePascal 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 wrote:
           | > _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.
        
       ___________________________________________________________________
       (page generated 2023-06-17 23:02 UTC)