FreePascal Compiler Z80 backend stabilized!

Por pgimeno

Master (176)

imagem de pgimeno

27-04-2020, 19:38

https://wiki.freepascal.org/Z80

Quote:

As of Apr 27, 2020, the code generator is stable enough to compile the full system unit.

Looks very promising. FPC is a great compiler and supports versions of Pascal more advanced than TP3, including units among other things.

Currently the library support seems to focus on the Spectrum, and requires the SDCC suite.

Entrar ou registrar-se para comentar

Por rolandve

Master (218)

imagem de rolandve

27-04-2020, 23:33

Great! Turbo Pascal 3 is a very sloppy compiler. All routines/functions/variables not used, stay in the .com file, bloating it. MaxInt size of 65536 might be nice as default on 8 bits, etc.

Por PingPong

Prophet (3521)

imagem de PingPong

28-04-2020, 00:36

freepascal is oop! object oriented language on msx? crazy!

Por rolandve

Master (218)

imagem de rolandve

28-04-2020, 08:47

PingPong wrote:

freepascal is oop! object oriented language on msx? crazy!

oop ons MSX seems very hard to me. The overhead introduced by objects requires a lot of memory. Constructors/destructors, all the internal code doing checks (for example overloading). However, even with a c++ compiler, you can still create regular c programs, so we could probably still create standard pascal programs and skip the OOP business. After all, a 380kb hello world won't even load.

Por Giangiacomo Zaffini 2

Master (206)

imagem de Giangiacomo Zaffini 2

28-04-2020, 10:29

Pretty good to hear about that. I cannot fully understand the outcome of this FPC enhancement.
Nonetheless if developers will use FPC for Z80 and MSX, we will be in a better environtment. Cool

Por Grauw

Ascended (9072)

imagem de Grauw

28-04-2020, 11:18

I been writing OOP in assembly for years! Big smile

Generally you construct most objects at the start, so you can take all the time in the world, and it does improve code readability. In essence OOP is not much more than passing around pointers to structs and some naming and calling conventions.

It’s cool that a higher level OOP language exists now. Would be cool if C++ became available to us at some point too (maybe someone finally manages to implement a LLVM backend).

Por PingPong

Prophet (3521)

imagem de PingPong

28-04-2020, 21:09

i know, i'm a c++ programmer from '90.
That is because i'm curious about this compiler, to see how are 'rendered' on a humble z80 things like virtual table methods and so on

Por PingPong

Prophet (3521)

imagem de PingPong

28-04-2020, 21:12

Grauw wrote:

In essence OOP is not much more than passing around pointers to structs and some naming and calling conventions.

the problem is the overhead introduced to support these things. For example thing about a c++ class inheriting from two base ones and think about doing some kind of dynamic_cast<>. The overhead that is introduced to support a similar thing by a c++ compiler (virtual method tables, RTTI support) is somewhat heavy for a 8 bit processor like a 6502 or z80