Pascal-P2 is a Pascal compiler/interpreter created by Niklaus Wirth and his students in ETH/Zurich. The implementation was termed Pascal-P, ostensibly for "portable".
The Pascal-P series of compilers were the first Pascal compilers written in Pascal itself (prior to that was a version in Fortran, see "history"). Wirth wanted to create a "logical machine" to run the new Pascal language and compile to that. This implementation would then be used as a starting point for actual machine compilers. Although this technique was not unique in the 1970's (for example BCPL had used this in 1967), it became a very popular, especially with respect to the new microprocessor implementations.
- Pascal-P was used as the starting point for the CDC 6600 compiler. Pascal-P2 was used as the starting point for UCSD Pascal Pascal in the late 1970's.
- Pascal-P2 was later improved to become Pascal-P4 by the Zurich group. This was the last Pascal-P compiler out of Zurich.
- Pascal-P4 was later expanded to include all of ISO 7185 Pascal in California, USA, and that work was termed Pascal-P5.
- Pascal-P2 serves as a very compact compiler/interpreter for a very regular language. As that, it serves as an example in university courses on compilers.
When the Pascal language was designed by Niklaus Wirth, the available machine was a CDC 6600 series machine, at the time considered a "supercomputer". The desire was to code the compiler for Pascal in Pascal itself, and thus "bootstrap" the compiler. The design goal of the first compiler was as an example of Pascal implementation, and a porting kit. To that end, the compiler processed the minimum subset of Pascal that would self compile.
Pascal-P1 was considered the early group of compiler versions.
Pascal-P2 was a subset of the Pascal language as it existed in the early 1970s. It does not understand write/ln or read/ln without a file parameter (default to output or input). Pascal-P2 Probably has other limitations. The above list was taken from Pascal-P4. Since Pascal-P2 is not in common use, these details are limited.
As a compiler/interpreter, Pascal-P2 is likely restricted to classroom use. A runnable version of it is available in SourceForge (see links below). Its main value would be as example or class project code. It is a relatively small implementation that can compile itself. Further development of the compiler/interpreter is available in further versions as Pascal-p4 and Pascal-P5.
Pascal-P2 does not bear any sort of legal notice or license. However, the chief author of Pascal-P2, Niklaus Wirth, has been quoted as saying that he considered it to be public domain, and it was freely distributed. Much has been made of the Berne Convention on copyright which makes copyright in the applicable member countries automatic as being a "defacto" copyright restriction on any such code. However, the free distribution of the code and the statement of the author seems (to this author) enough to firmly establish it as a public domain work.
There is a popular misconception that Pascal-P2 was considered the first "Byte Machine", or logical interpreter based on byte level instructions and operands. Byte machines became very popular later, especially with respect to the Java (programming language). This is incorrect. Pascal-P2 was based on the 60 bit instruction word used in the CDC 6600 series computers. UCSD, which was based on Pascal-P2, converted the code to use byte machine semantics. What would now be considered a "Byte Machine" was also used in BCPL, an earlier project, and perhaps others. A later version of Pascal-P, Pascal-P5, also uses byte machine semantics.
- Pascal-P2 compiler source - The source code for the compiler for Pascal-P2
- Pascal-P2 Assembler/interpreter source - The source code for the assembler/interpreter for Pascal-P2
-  - Pascal-P2 project on Sourceforge
-  - The manual published by N. Wirth in 1972 for the language Pascal.
-  - The "Axiomatic definition of Pascal". This was a definition of the language using formal notation (axioms)
-  - Notes on the implementation of Pascal-P from Zurich.
-  - A series of example programs in Pascal, from N. Wirth/Zurich.
- Pascal-P – the Pascal-P compiler and versions
- Pascal-P5 – Pascal-P5 web page
- Pascal-P5 source code – Pascal-P5 project on SourceForge
This article "Pascal-p2" is from Wikipedia. The list of its authors can be seen in its historical. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.