You Got Your Pascal in My JavaScript

Rmag Breaking News

At the Mountains of Madness

Welcome to my (deeply disturbing?) series of articles where we will build a tool chain that will allow us to compile and run Pascal p-code with JavaScript. This introductory article will explain a bit about the history of Pascal in particular the p-code machine that allowed Pascal to take the world by storm in the late 70s. But first…

Why am I doing this madness? Probably because Pascal was my first love (sorry Basic, it was just a phase) and JavaScript is what I do now. Now you must be wondering how decrepit I must be. You can just keep on wondering. Nicklaus Wirth died recently so it’s also a tribute to the great man. Hopefully he won’t be rolling in his grave. Mostly I am doing this because it will be great fun and I will get to use everything JavaScript has to offer.

The Overall Plan

There are two major pieces to this project the p-code VM and a Pascal compiler. I won’t be doing this in a vacuum. I will be basing my work on existing code written in Pascal.

A Bit of History

During the early seventies the folks at ETH Zurich wrote a series of Pascal compilers written in Pascal that generalized the output to run on a stack based vm much like Java and .Net (very forward thinking). They were numbered P1,P2,P3 and P4. These were freely distributed with only a small fee to cover the cost being charged. The source code lives on thanks to Scott A. Franco at Standard Pascal. There is a very comprehensize discussion of this at Pascal-P: The portable Pascal compiler

Leave a Reply

Your email address will not be published. Required fields are marked *