Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Pascal P4 revisited (Developers)

posted by Rugxulo Homepage, Usono, 04.11.2022, 22:39

> Pascal-P, 1972-74
>
> It had always been a major goal in the development of Pascal to demonstrate
> that structured languages need not be inferior to the predominant Fortran, if
> sufficient attention and care was paid to their implementation. But it soon
> became clear that industry had no interest in undertaking this
> demonstrations, although such engineering projects typically should fall into
> industry's domain. A second Pascal compiler effort was therefore launched at
> ETH. The new compiler produced code that was as good as that generated by
> commercially developped Fortran compilers. Furthermore, this project served
> as a test for the method of stepwise program refinement propagated by Wirth.
> A fringe benefit was the welcome capability to satisfy requests to help
> implement Pascal on other computers, as these requests from other
> universities became more frequent. The solution lay in replacing the new
> compiler's code generator by one producing code for a hypothetical
> architecture that was easily implemented on other machines in the form of a
> hand-coded interpreter. This architecture, stack-based, became known as the
> P-machine, its instruction set as P-code. (P for portable). It bacame the
> basis of the large majority of Pascal implementations which first appeared on
> large-scale computers (IBM, Univac, DEC, Siemens). But the genuine break
> -through occurred after microprocessors became widely available and it became
> clear that Pascal-P implementation was feasible for them (UCSD- Pascal).

ETH Zurich released the Pascal P4 (pcom/pint) bytecode compiler as "public domain" back in 1976. This was later documented in Steven Pemberton's book (now freely available online). However, he provided C code (via p2c, dated 1996) that didn't really work. Scott Franco not only extended P4 to full ISO 7185 in P5 but also made some minimal fixes to P4. Note that P4 lacks several features and is very inefficient with memory, but it does work.

Based upon Scott's fixes, I retranslated (with p2c) and recompiled it with OpenWatcom and GCC, successfully runnning Scott's (partial) tests.

* P4_EXE.ZIP (390 kb: DJGPP, OW/Win32, EMX, OW/Linux)
* P4_SRC.ZIP (121 kb: .P and .C sources with patches and test suite)

P5 is much better but still itself written in ISO 7185 Pascal, which I think is a mistake. (GPC is dead, FPC is imperfect.) P5C requires newer GCC or Clang to translate. In other words, this effort is redundant and incomplete but still better than nothing.

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 259 users online (0 registered, 259 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum