An interpreted language

If you have ever programmed, you probably know there are 2 different types of programming languages: compiled and interpreted languages. With a compiled language, the code is reduced to a set of machine-specific instructions before being saved as an executable file. With interpreted languages, the code is saved in the same format that it was entered and it gets converted to machine instructions at runtime. Some languages, such as Basic, are available in both a compiled and an interpreted version.

PostScript is a language that is interpreted. There are no PostScript compilers.

Compiled languages

A programming language that can be compiled is translated to machine-ready instructions on the system where the program was written. As a user, you get the compiled program that can run directly on your computer systems. Compiled programs run fast but they are created for a specific type of processor and cannot be executed by another processor. To fix errors in them, you also need the source code of the original program. All the programs that you buy for your computer, like games, office apps and so on, are compiled programs.

PostScript code gets interpreted

PostScript is an interpreted language: when you create a page in QuarkXpress and print it, QuarkXPress creates a PostScript program that describes the content of your masterpiece and sends this to the output device you selected. This output device, say a laser printer, has its own computer which run a program called a RIP. This RIP program reads the PostScript instructions line by line and then translates them into something that the processor of that RIP can process.

The fact that PostScript code is always interpreted has a few distinct advantages:

  • Because the PostScript code is interpreted, it is not geared toward a specific CPU and can be sent to a variety of output devices, all possibly using completely different types of processors. This makes PostScript a device independent language.
  • Another advantage of PostScript being an interpreted language, is the fact that you can change the code yourself if you do not like the resulting output or if it generates some error message. Of course this is only possible if you know how to program in PostScript or what to look for. Even though I have never programmed in PostScript myself, I have in the past occasionally had a look at code and fixed it. For example: in one case, I got pages that were printed from a CAD program. All the lines in the drawings were too thin so I changed the variable that defined the line thickness. I also added an instruction to change the scale of the pages and added the code to select a proper page size. Nowadays I use Acrobat to convert PostScript files to PDF so I can use the multitude of Acrobat plug-ins there are to change aspects of the code. Editing PostScript becomes less and less of a necessity.

Of course interpretation also has its disadvantages:

  • The disadvantage of an interpreted language like PostScript is its lack of speed. The extra translation that has to take place takes up extra time. This is less of a problem nowadays but ten years ago, RIPs could spent hours interpreting PostScript code even though they used more powerful hardware than the computer that was used to create the pages.
9 August 2013

One response to “An interpreted language”

  1. pavan says:

    The difference between the interpreted and compiled programming language is useful to all students who are studying the microcontrollers this is basic knowledge fir learners.