and more (note: the runtime system only supports ASCII
based systems; that includes almost all of today's systems, but a
few IBM machines still use EBCDIC; on those, the compiler might run,
but the runtime support might need major changes),
can act as a native or as a cross compiler between all
supported systems,
produces highly optimized code for all these systems,
parts of Borland Delphi, Mac Pascal and Pascal-SC (PXSC).
Some highlights:
From Standard Pascal: Many popular Pascal compilers claim to
extend Standard Pascal but miss these important features.
Conformant array parameters – the standardized and comfortable way
to pass arrays of varying size to procedures and functions.
[Example]
Passing local procedures as procedural parameters – with full
access to all variables of the “parent” procedure.
[Example]
Automatic file buffers and standard Get and Put
procedures. Read ahead from files without temporary variables.
[Example] This allows you, for instance, to
validate numeric input from text files before reading without
conversion through strings. [Example]
True packed records and arrays. Pack 8 Booleans into 1 byte.
[Example]
Internal files. You don't have to worry about creating temporary
file names and erasing the files later.
[Example]
Global goto. (Yes, goto has its place when it is not
restricted to the current routine.) [Example]
Automatically set discriminants of variant records in New.
[Example]
True network-transparent CRT unit: You can run your CRT applications
locally or while being logged in remotely, without any need to worry
about different terminal types. Compatible to BP's unit, but with
many extensions, such as overlapping windows.
[Example]
Fully functional GUI (X11) version of CRT (also completely
network transparent).
The Random function can produce the same sequence of
pseudo-random numbers as BP does – if you need that instead of the
much more elaborate default algorithm.
Supports BP style procedural variables as well as Standard Pascal's
procedural parameters. [Example]
A Ports unit lets you access CPU I/O ports on systems where
this makes sense. [Example]
Special compatibility features to help migrating from BP to GPC,
like a GPC for BP unit which provides some of GPC's features
for BP, and some routines to access sets of large memory blocks in a
uniform way under GPC and BP (even in real mode).
[Example]
Comes with a BP compatible binobj utility.
[Example]
From Borland Delphi:
abstract object types and methods
is and as operators to test object type
membership
Comments with //
Empty parameter lists with ()
Assertions
A SetLength procedure for strings makes it unnecessary
to use dirty tricks like assignments to the “zeroth character”.
Initialize and Finalize for low-level handling
of variables.
initialization and finalization for units.
From Pascal-SC (PXSC):
User-definable operators. Add your vectors with +.
Carefully designed GNU extensions help you to make your
real-world programs portable:
64-bit signed and unsigned integer types.
Special types guarantee compatibility to other GNU languages such as
GNU C. Directives like {$L foo.c} make it easy to
maintain projects written in multiple languages, e.g., including
code written in other languages into Pascal programs
[Example (Pascal part)][Example (C part)],
Posix functions like ReadDir, StatFS or
FileLock provide an efficient, easy-to-use and portable
interface to the operating system. [Example][Example][Example]
A DosUnix unit compensates for some of the incompatibilities
between two families of operating systems.
[Example]
An MD5 unit to compute MD5 message digests, according to RFC
1321. [Example]
A FileUtils unit which provides some higher-level file and
directory handling routines. [Example]
A StringUtils unit which provides some higher-level string
handling routines. [Example]
A Trap unit to trap runtime errors and handle them within
your program. [Example]
A TFDD unit that provides some tricks with text files, e.g. a
“tee” file which causes everything written to it to be written to
two other files. [Example]
A HeapMon unit to help you find memory leaks in your
programs.
The demo programs mentioned above are available both on the WWW and
in GPC source and binary distributions.
Disadvantages:
The GNU debugger (GDB) still has some problems with Pascal
debug info.
Compilation with GPC takes quite long.
Co-workers welcome!
Able, committed programmers are always welcome in the GNU Pascal
team. If you want to be independent of companies that you have to
pay in order to get a compiler with more restrictive licensing
conditions that only runs on one operating system, be invited
to join the development team, Acknowledgments.