Download Latest Version pascal-p5c-code-r76.zip (3.9 MB)
Email in envelope

Get an email when there's a new version of pascal p5c

Home
Name Modified Size InfoDownloads / Week
p5x 2021-04-01
pascal-p5c-code-r76.zip 2023-06-13 3.9 MB
pascal-p5c-code-r67.zip 2023-06-13 3.6 MB
p5c-good.c 2023-06-13 641.7 kB
pcom.pas 2023-06-13 511.6 kB
tp5c.pas 2023-06-13 294.0 kB
iso7185pat.pas 2023-06-13 131.2 kB
changes.txt 2023-06-13 8.6 kB
README 2023-06-13 5.2 kB
patCheck.awk 2021-04-01 8.1 kB
sys.inc.pas 2021-04-01 910 Bytes
r 2021-04-01 6.3 kB
p5c.h 2021-04-01 3.0 kB
guide.txt 2021-04-01 134.3 kB
clib.inc.pas 2021-04-01 3.3 kB
pascal-p5c-code-r51.zip 2019-02-12 3.6 MB
pascal-p5c-code-41.zip 2018-05-11 2.6 MB
Totals: 17 Items   15.5 MB 4
Pascal p5c                                                     release 1.3.1

This is a version of p5 pascal that is
   - easily portable
   - full iso standard (level 1) and
   - generates fast programs.

It can achieve this because it generates gnu c code instead of p code.

It's portable because you need only gnu c to get it running on your system.
gnu c is very widely supported and distributed, so is available just about
everywhere.

It is fast not only because it generates executable code, but it uses gcc
which is known for producing highly optimised code.

It's got arbitrary set limits and is fully standard, so it's got conformant
 arrays, function paramaters and all that.

p5c is derived from pascal p5, which is a freely available, well documented
and fully standard pascal compiler.

See guide.txt for more.


This version has faster compile speed, better error handling, more tests,
bug fixes and many minor improvements. see changes.txt for details



getting started
===============

step 1: get gcc
  gcc is widely supported and distributed.
  To get gcc for windows, search for mingw, cygwin or delorie.
  Linux and other unix type systems likely have gcc already installed.

step 2: compile p5c.c
 make sure p5c.h is in the current directory or where gcc can find it
 use something like this command in the gnu bash shell:
        gcc -I . -o p5c p5c.c -lm

 Other systems should have similar commands.

step 3: compile your pascal program
 for p5c, compiling is a 2 stage process, the first is to compile the pascal
 into c, the second is to compile the c code into an executable.
 eg, for the obligatory hello world:
        p5c hello.pas hello.c > hello.lst
        gcc -lm -I . -o hello hello.c

step 4: run the program
        ./hello


status
======
p5c is now complete and should compile all programs that conform to level 1
of the ISO 7185:1990 pascal standard. It also rejects nearly all
nonconforming programs, either at compile time or run time

See the file changes.txt for a description of changes since the previous
version of p5c.



Version:
========
This is derived from the latest version of p5, taken from the git repository

As stated above, p5c is based on pascal p5, which is a freely available,
well documented and fully standard pascal compiler.
You can get it from sourceforge.net/projects/pascalp5

The following excellent descrption of p5 is taken from a dos version of p5.

Author:
=====
  This was original Pascal-P4 from ETH Zurich in the '70s, a subset
Pascal bytecode compiler and interpreter widely distributed as help in
porting Pascal to other architectures. There were various ETH Zurich
people involved (as listed in sources). Later, Steven Pemberton wrote
a book documenting it, which is also online nowadays. In recent years
(circa 2008-10), it was brought up to full "classic" (ISO 7185) Pascal
by Scott Moore (of IP Pascal).

License:
=====
  According to Steven Pemberton, Niklaus Wirth told him way back when
that it was "public domain". Scott Moore has also put his improvements
into the public domain. Scott is also pretty diligent about getting
permission for docs (and has tons more of it on his website).
[Similarly, all additions for p5c are in the public domain.]

Dialect:
=====
  This is not Turbo/Borland/Delphi compatible at all. All of the
(biased) complaints from Kernighan (BWK) still apply, more or less:
no dynamic arrays (or strings), no default (else) in case statements,
no getting or writing to raw addresses or untyped pointer variables,
no units or modules or include files, no named files, etc. This is 99%
the exact same language as originally defined by Wirth (and later
slightly clarified in the ISO 7185 standard circa 1982). It is
probably most accurate to say this language was designed for efficient
compilation, strong typing, structured programming, and especially
teaching algorithms and dynamic data structures (as per the book of
similar name by Wirth). However, there is an additional implementation
limitation here of only reading from a "prd" and writing to "prr"
external files (in order to self compile). This is somewhat annoying
but may be lifted if P6 is ever begun. You can work around it (barely)
if direly needed by inserting the input after the bytecode (see
pintm). There were intentionally no language extensions added to this
compiler.
[Edit:
There is no such restriction in p5c, it can easily read and write external
files.
See tfile.pas & notes in guide.txt
]

Legacy:
=====
  There are not a lot of truly conforming ISO 7185 compilers left in
the world. Pascal is over 40 years old by now, but what is left of it
in popular use is usually some heavily-modified derivative (e.g.
FreePascal). Even Wirth himself would probably suggest instead using
one of his later languages (e.g. Oberon-07). The newsgroup
news://comp.lang.pascal.ansi-iso is a ghost town, but if really
curious, feel free to read up on stuff there. Personally, I'd suggest
just reading Scott Moore's website, Wirth's A+D=P book, Doug Cooper's
books, Pemberton's book, or similar. So this is probably most
interesting to those with a deep historical bent or those who are
curious to see how it all began.

Source: README, updated 2023-06-13