Programming Language Design

The MIT Press eBooks · 1997

Program file for this chapter: pascal This chapter and the next are about two related things: why different programming languages are different and how a programming language is implemented. To make the discussion concrete, I’ve chosen a specific language as an example: Pascal. That choice seems appropriate partly because Pascal is very different from Logo and partly because it is widely used as a vehicle for teaching introductory computer science, the same task I’m attempting in this book using Logo.* For the purposes of this book I’ve written a program that translates a small subset of Pascal into a simulated machine language. You can get a real Pascal compiler for your computer that accepts the full language, and that’s what you should do if you want to learn how to program in Pascal. I had two reasons for writing this subset compiler. One is that some readers may not otherwise have access to a Pascal compiler, and mine, despite its limitations, will enable you to explore the parts of the language I’m going to be talking about. The other is that the next chapter is about how a compiler works, and this compiler is accessible to examination because it’s written in Logo.

Read the paper · More papers on PaperTik