-
Notifications
You must be signed in to change notification settings - Fork 12
Home
Please forgive the state of this project, it is under development
Hi and welcome to the project. This is the GIT public depository for Pascal-P6.
Pascal-P was a series of compilers starting at Zurich. The last of the series from Zurich was the Pascal-P4 compiler, which is available at:
https://github.com/samiam95124/Pascal-P4
It compiles and runs a subset of the Revised Pascal language. That subset was designed to be the minimum language required to self compile for a new machine implementation. It was part of a "bootstrapping" kit designed to facilitate porting Pascal to new machines.
Pascal-P5 is the next increment beyond Pascal-P4, and is extended to include all of the ISO 7185 Pascal language, as well as incorporate a series of ISO 7185 Pascal test services. It also includes the ability to self compile "out of the box", that is, it can compile and interpret itself as is (with only a few one line changes), something the original Pascal-P could not do. It is also a full language compiler, not a subset.
It is available at:
https://github.com/samiam95124/Pascal-P5
Pascal-P6 is the next step beyond Pascal-P5. P6 is the place for all of the things that didn't really belong in P5:
- To also compile to a target machine, the 80386 (and perhaps other machines), as well as interpret.
- To support language extensions.
Pascal-P6 implements a language based on ISO 7185 called "Pascaline", named after the calculating machine Blaise Pascal was famous for inventing.
http://www.standardpascal.com/pascaline.htm http://www.standardpascal.com/pascaline.pdf http://www.standardpascal.com/pascaline.docx
Most extended Pascals are based on ad-hoc additions to the language. I wanted to create a new language that was not just a shopping cart of features, and so I put a lot of work into coming up with a language that fit together as a whole, and still maintained the style of Pascal.
Whats the difference between Pascaline and other extended Pascals? When Pascal debuted in the 1970s, it was extended by several variants of the language to look like Basic (UCSD and Borland), and then in the 1980s and beyond extended to look like C, while retaining Basic string handling (Borland). This language family is well represented by Borland products and the great FPC or "Free Pascal" project today.
What Pascaline does is extend the array handling to cover dynamically created arrays (including of char), and create a type system based on classes (objects). At the same time Pascaline heavily covers modularity and especially multitasking/parallel tasking.
The basis for Pascaline is type safety/security (what has been derided as "Pascal as a B and D language" or "Bondage and Disclipline" language. However, type safety and security made a comeback with languages such as Java, C# (designed by the same author as Borland Pascal) and others. Thus, Pascaline is a type secure language that was always so, back through ISO 7185 Pascal.
in 1980, I created a Z80 compiler (with no specific name). It was ISO 7185 compliant, and added a series of file handling functions like assign, close, etc., and also modularity along the lines of C. Procedures and functions used the "external" word-symbol, and Pascal components such as procedures, functions, variables, etc., could be put into separately compiled files. This compiler was written in Z80 assembly language.
In 1987, I started a second implementation on 80386 processors, entirely re-written in Pascal using the SVS 32 bit compiler (now defunct). This had the file handling of the old compiler, a new system of modular components, and variable length arrays. In 1993, that became operational. This was IP Pascal.
In 2003, I created a new specification that used the existing language of IP Pascal and greatly extended it. This was implemented on IP Pascal, and became the basis of the Pascaline specification.
P6 is implemented in ISO 7185 Pascal. How is that possible? Actually most of the mechanics of a lanuguage, the storage allocation, the data manipulation, have little to do with the implementation language. Its a long tradition to write a new, extended version of an old language using the old implementation. Pascal itself was extended in this way.
The main issue with using an ISO 7185 compiler to create an extended compiler are the system calls, which typically center around the file management system. Its a basic operating system interface, and it can't be coded around. P6 handles that by using a series of "escape" routines for things like open file by name, seek in file, etc. In ISO 7185 mode, these are stub routines that just generate errors. However, in a non-ISO 7185 environment, they are filled out with the operations in terms of the host compiler. With A Pascaline compiler, they are filled out with Pascaline file operators.
What the repository contains This repository contains the working set of files for the Pascal-P6 project. It contains all files, including source for the compiler, scripts to build, run and test it, and a full set of tests.
See the file "the_p6_compiler" in several document formats for all information on the project.
The procedure to distribute Pascal-P6 is to zip up a "release" with a new version number. This exists in the "release" area here on Github. In the meantime, you can get a file set from the code tree. Getting your code directly from GIT is essentially Alpha testing.
- Upgrade Pascal-P5, an ISO 7185 standard compiler, to fully implement Pascaline, an extended Pascal language.
- Be a model of the implementation of a Pascaline compiler.
- Have as few differences between Pascal-P6 and Pascal-P5 as possible.
Q. Is Pascal-P6 compatible with Borland Delphi?
A. Pascal-P6 is the original compiler and language from 1973, Delphi, or rather it's parent project Turbo Pascal, was was created in 1983 and wasn't compatible with Pascal.
Q. Is Pascal-P6 compatible with FPC or Free Pascal?
A. Some part of it. FPC accepts programs from the ISO 7185 1983 Pascal standard with appropriate options.
Q, How old is the language Pascal?
A. The language originated in 1973, and was standardized by ISO 7185 in 1983.
Q. Isn't the original language Pascal dead?
A. Original, standard Pascal still had widespread support in commercial compilers up to about 1995. It was supported further by GPC (GNU Pascal) up to about 2010. It is true that commercial compiler support for the language fell off in about 1995, but then most commercial compilers for all languages stopped about that time, in preference to open source compilers.
Q. Whats the major difference between original Pascal and the FPC/Delphi dialects?
A. Original Pascal was, and is, a very type secure language that lacks the type casts and loose type conversions of FPC/Delphi. There is nothing wrong with that, but FPC/Delphi became a mix of the Pascal and C languages. In later years, with the rise of Java, C#, and of late languages like Go, Rust and similar languages, type safety has had a renaissance, largely due to C and similar languages reputation for lack of such security.
Q. What are the major themes of Pascaliine?
A. Pascaline addresses all of the original weaknesses of Pascal, such as reliance on fixed array sizes and lack of modularity. It adds emphasis on parallel tasking, classes, and a standard library reaching graphical presentation, networking and more. It does this while maintaining full compatibility with original Pascal and fully maintaining type security.
Q. What is the Pascal-P6 compiler?
A. The Pascal-P6 compiler is the original compiler from Zurich in the 1970's extended to process the full Pascaline language.
Q. How can you access C language routines in a language without C style typecasts?
A. In other Pascal dialects, you are given a series of type cast operations, and you use routines to convert types to and from C routines. The Pascal-P6 compiler will automate all of that, including automated conversion of C language headers to Pascaline. There are no cast operators because you don't need them. You call C routines using Pascaline regular calls, and those calls are automatically converted for you. No need to manually convert operands. Linux, Windows, Mac OS/X and the world speaks C, and Pascal-P6 integrates with the C language to an extent far above previous compilers, including FPC and Delphi.
Q. How old is Pascaline?
A. I created my first Pascal compiler in 1980 (yes, years before Turbo Pascal). The language Pascaline dates from that time, with major advances in 1995 and 2010.
Q. What is the Pascal-P6 implementation language?
A. Pascal-P6, and the entire Pascal-P series, is written in Pascal, with later Pascal-P6 adding extensions from Pascaline. There are considerable support sections in C, but an effort was made to use only the most common C standards, namely C89.
Q. Will Pascal-P6 support other dialects? FPC or Delphi?
A. In my opinion, GPC (GNU Pascal) was killed in part by trying to be everything to everyone, including supporting multiple dialects. The FPC and Delphi dialects are well covered by FPC and Delphi. The aim of those dialects was to combine Pascal with C. There is nothing wrong with that, but it is in opposition to type safety, and therefore in opposition to the ideas behind Pascal-P6 and Pascaline. The best advice I can give FPC and Delphi users is to use and enjoy FPC or Delphi.
Q. How tied into the GNU/GCC toolset is Pascal-P6?
A. Quite a bit, however, the main dependency is on the GAS or GCC assembler. This can be changed with moderate effort. Also clang is compatible at the assembly and C language level with GCC, and so that is an alternate toolset.
Q. Didn't overdependence on GCC toolset kill GPC? Why is Pascal-P6 different?
A. GPC was dependent on the intermediate format of GCC, which is very complex and very dependent on GCC. Pascal-P6 does not use that, but rather the AMD64 assembly language. Also the major part of Pascal-P6 is written in Pascal-P6's own language, Pascaline.
Scott Franco (admin)
I'm Scott Franco, formerly Scott Moore (got married). I wrote my first compiler in about 1978, a basic compiler, at the tender age of 19. At that time, in the microprocessor industry, compiled languages were not widespread, but I was eager to get my hands on one. We programmed almost exclusively in assembly language. I asked one of the senior staff programmers what language he would prefer if he had a compiler, and he answered "Pascal", which was pretty new at that time.
By 1980, I had my first Pascal compiler running, a Z80 (8 bit microprocessor) compiler. Since then I have worked on Pascal issues and compilers. This work slowed down in the early 1990's, because I used other's existing compilers, but came back in the late 1990's when ISO 7185 compilers began to disappear.
For anyone with the interest, I can provide a set of printed and perfect bound manuals, 9 by 7 inches. See the top of this page for a photo. I use bound material here locally, and would be happy to provide manuals for others at my materials cost (non-profit). I used a calculation based on 3 cents per page, which many sources list as the net printing cost per page of black and white laser copy, considering paper, toner, printer maintenance, etc. There is also Cafe press perfect binding at 10 cents per page, in case you want to print and bind by an outside service[1].
The manuals shipped will be identical to the electronic copies in the archive at the time I receive the request. You can get as many versions as you want by reordering. I recommend waiting for new versions to come out.
The costs are:
Cost of materials and shipping for Pascal-P6 manual set
$6.92 Postage, media mail
$1.34 Envelope
808 Total pages in manual
$0.03 Cost per page[2]
$24.24 Total cost to print
$32.50 Total cost
If you want a copy, please contact me at: samiam@moorecad.com
The US postal service gives a special "medial mail" rate that is the same regardless of location in the USA (I suppose to encourage reading). For addresses outside the USA, please email me and given the destination address, and I will find a rate and reply with it.
The pocket edition!
[1] The covers, in 19x11 inches, are in the /doc directory as xxx_cover.docx. I use Microsoft word to print them.
[2] I found estimates for cost per page of laser printout all over the map, from 1 to 10 cents. I choose what seemed like a reasonable average on the low side.