[fpc-pascal]FPC vs. GPC (was:FPC 1.0.6 and open arrays)

Michael Van Canneyt michael.vancanneyt at wisa.be
Tue Jan 28 15:38:33 CET 2003


On Tue, 28 Jan 2003, Andreas K. Foerster wrote:

> On Mon, Jan 27, 2003 at 10:42:37PM +0100, Marco van de Voort wrote:
>
> > > Will there also be sopport for conformant Arrays as they are defined
> > > in standard Pascal (ISO-7185)?
> >
> > Not that I'm aware of (unless you plan to implement it ? ).
>
> No, I can't do it.
>
> The point is just, that I'm still disappointed that FPC isn't
> compatible to any of the official Pascal standards and that it's not
> even trying to become compatible.

We only aim to be Delphi compatible. It is the de facto pascal standard,
and is a usable implementation of pascal.

Most other standards are academic and not very usable.

>
> I'm very much drawn back and forth between FreePascal and GNU Pascal.
> Both have their advantages, but also their disadvantages. FreePascal
> has more commands, but GNU Pascal knows a much more elaborated syntax.
> FreePascal supports just one dialect, GNU Pascal knows different
> dialects including the standards.

FPC has 4 dialects:
- plain
- TP compatible
- Object pascal
- Objectpascal, delphi compatible.

> FreePascal has lots of systemspecific
> extentions, but programs written with them aren't portable,
> even not between the different variants of FreePascal itself.

A. Which variants of FPC do you mean ?

B. It is in the nature of system specific things that they are not
   portable. Only the RTL and FCL are designed with as much portability as
   possible kept in mind.

All packages are system specific, and are used to make the compiler more
usable on all platforms.

> GNU Pascal tries to leave systemspecific things away, that means that
> programs are nearly always portable, but also that things are missing.

Exactly, thus severely limiting the usability.

> GNU Pascal (the compiler itself) is very portable, while FreePascal is
> mainly targeted to PCs and porting to other platforms seems to take a
> lot of time.

We are working on this, but this is not an easy task.

Do not forget that GPC used GCC as a basis which already existed for
more than 10 years when GPC was initially ported. So any comparison
in this is meaningless. In 10 years we'll look where FPC and GPC are.

> On the other hand GNU Pascal is hard to install,
> especially on non-Unix systems. GNU Pascal is the better Pascal, when
> you look at the source code of your programming, but FreePascal is the
> better compiler, when you look at the binary that comes out...
>
> What I really want would be a mixture of both!
>
> At the moment I try to use only what both have in common. But
> unfortunately that's not much. I have to avoid commands because of
> GPC and I have to use a simpler syntax because of FPC.
>
> That's why I try to suggest that FPC should become more standard
> compatible, to be able to write more portable code.

Portable code has nothing to do with standards.
We try implement the Delphi standard on all supported platforms.

>
> Okay, I see that it's difficult to implement.
> But what about things that look similar?
>
> For example initialized variables...
>
> FPC has this syntax:
> const i: integer = 0;
> But it's so very unlogical to use a "const" as variable. :-(
> (GPC accepts this syntax, but gives a warning)
>
> Extended Pascal (ISO-10206) declares this syntax:
> var i: integer value 0;
> Much nicer, isn't it?

What is so much nicer about this ?? We support the following:

var
  i: integer = 0;

Which is even much nicer.
'Nice' is largely a matter of taste, and hence is no argument.

That it is a standard is another matter.

>
> That at least looks very similar so I hope, at least that will be
> simpler for you to implement...
>
> BTW. you might wonder why Extended Pascal uses "value" and not the
> equal-sign. That is because it also defines initialized types:
> type myint = integer value 0;
> so that all variables that use this type are initialized.
> Here a second equal-sign would look strange.
>
> Or what about String definitions:
> FPC:
> var s: string[255];
> ISO-10206:
> var s: string(255);  {btw. not limited to 255}
> Would it be so difficult to accept parantheses instead of brackets?
> GPC accepts both.

If we decide finally to implement the ISO or ANSI pascal mode, then we
may consider all this, but at this moment it is definitely not a
priority.

FPC is an open source project. Feel free to grab a copy of CVS and
implement it yourself. We'll be happy to include your changes.
But our priorities lie elsewhere...

Michael.




More information about the fpc-pascal mailing list