Languages Used for Lecture 01

Programming languages are ubiquitous in the world of computing. As an example, consider the languages used to prepare this lecture.

CS4215 Module Homepage

The module homepage is written in the language HTML. An example HTML fragment is displayed here:

      <td> 01 </td>
      <td> 17/8 </td>
      <td> Languages and Language Processing </td>
      <a href="slides/slides_01.pdf">slides_01.pdf</a>
      <a href="notes/notes_01.pdf">notes_01.pdf</a>
      <td>If you are interested in the mathematics behind T-diagrams,
take a
look at the original paper: J. Earley and H. Sturgis. <a
formalism for translator interactions</a> . Communications of the ACM,
13:607-617, 1970.<p>
Programming languages are ubiquitous in the world of IT.
To illustrate this point, a
<a href="html/languages_for_this_lecture.html">description</a> 
is given what languages were used to produce the slides
for lecture 01.
This HTML code is interpreted by your web browser to produce formatted text with hyperlinks so that it looks like this:

01 17/8 Languages and Language Processing slides_01.pdf notes_01.pdf If you are interested in the mathematics behind T-diagrams, take a look at the original paper: J. Earley and H. Sturgis. A formalism for translator interactions . Communications of the ACM, 13:607-617, 1970.

Programming languages are ubiquitous in the world of IT. To illustrate this point, a description is given what languages were used to produce the slides for lecture 01.

Source Code for Slides

The slides were produced using the typesetting program LaTeX. This language provides support for high-quality typesetting of mathematical formula. For details, see LaTeX homepage. An example fragment of the LaTeX source used for the first lecture is given here:

\item Translator translates from one language---the \emph{from-language}---to 
another language---the \emph{to-language}
\item Compiler translates from ``high-level'' language to ``low-level''
\item De-compiler translates from ``low-level'' language to ``high-level''

The slides make use of a powerful LaTeX package for making slide presentations, called Beamer.

For students who are inclined to play with LaTeX and who which to re-create the course notes and slides, the support files beyond a typical LaTeX implementation are available in the latex folder of the module homepage.

Device-Independent Format

The LaTeX source was then translated to an intermediate format called DVI (DeVice Independent). This format was developed in order to describe the visual layout of a document in a manner not reliant on any specific image format, display hardware or printer.

ps:: clip ï
ps:: newpath ïNps:: 3.9851 362.8394 pgfV 0.0 0.47499 0.45 0.47499 0.95 0.9 0.95 pgfshade  pop’l2ï	ps:: pgfcï	ps::[end]ŽŽï	color popï	color popŸ'+ïcolor push gray 0Ÿ™šïcolor push gray 0‘D4ïcolor push rgb 0.2 0.2 0.7žÌÍïps: ïps::[begin]ï	ps:: pgfoòps:: 2.5697 3.6697 1.6697 2.5697 pgfR1 2.1918 0.95 0.9 0.95 0.09999 0.09999 0.34999 pgfshade 1.59401 0.09999 0.09999 0.34999 0.14 0.14 0.49 pgfshade 0.797 0.14 0.14 0.49 0.4 0.4 0.775 pgfshade 0.0 0.4 0.4 0.775 0.88 0.88 0.955 pgfshade  0.88 0.88 0.955 0.0 pgfR2‘(œï	ps:: pgfcï	ps::[end]ŽŽ‘(œï	color popŽ‘lÐï	color popŽŽ‘æjºT‘ÿeranslato²!r–¦ftranslates“from“one“language|theŽ¤


The DVI file is then translated to PostScript, a page-description language for high-quality desktop publishing developed by Adobe Systems in 1982-1984. PostScript is a full-blown programming language that can be used to program the visual layout of a page. A PostScript fragment that corresponds to the DVI fragment above looks like this.

0 TeXcolorgray -2426 5229 a Fm(T)-101 b(ranslato)-34
b(r)405 b(translates)e(from)i(one)f(language|the)-2426
6734 y Fh(from-language)p Fm(|to)h(another)g(language|the)g
Fh(to-language)p 0 TeXcolorgray 0.2 0.2 0.7 TeXcolorrgb
-3603 8550 a


Finally, the PostScript file is translated to PDF, the de-facto standard for high-quality documents. PDF was also developed by the company Adobe Systems, which distributes an interpreter for PDF files, called Acrobat Reader. PDF is a binary format; a code fragment is given below.

®wľÙ~[ÕÖ¸“Hí¸øÑ0§yÜ+Úþ^gϏ/¯:©¸ï$—k hÓv´pRý¤ÛÂ.mœ³¦†Ø&{[ˆ%½Õ¯Òíc–Û`g«ÅrЃX£•ý¤ÙýÆê¶n^_u+}¼«¦~]ç6ÀëÍù¾d-ŸÊ.·׫„ëº[T¯íFk[Øåá£
xÖÄ+½…6ài¡qÐ>f¹öXQ¬+Êeá1Ž5dã	:!ț“Nè0^u‰è0nk`pRz4õþd—Ç&u÷švŽÝ®l–…»Ü]|ú°+zÒöe÷oX
×ía–š{«ÅŠqÐcX£eu|'¤í3KqÍý%çê9ULö±Õú—–=pX¥ÁWqi\êòÝy‡ñäV¯«nB/»wåVûûÅËú,¶UÞWƒÜꯃߣ<î

Unix Shell Commands

In order to perform the translations from LaTeX to DVI to PostScript to PDF, a sequence of corresponding translators is required. In OS X (Unix), the execution of these translator programs is facilitated by another program, called shell. A shell provides you with a command-line interface to the operating system of the computer, and therefore can be seen as an interpreter for the commands entered by the user. A popular shell for OS X is called bash; a bash session for performing the translations is given here:

Martins-MacBook-Pro:~/Documents/cs4215/slides henz$ latex slides_01
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
entering extended mode
LaTeX2e <2003/12/01>
(see the transcript file for additional information)
Output written on slides_01.dvi (49 pages, 739588 bytes).
Transcript written on slides_01.log.
Martins-MacBook-Pro:~/Documents/cs4215/slides henz$ dvips -P pdf -G0 slides_01.dvi
This is dvips(k) 5.95a Copyright 2005 Radical Eye Software (
' TeX output 2006.08.15:1330' ->

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] 
[13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] 
[28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] 
[43] [44] [45] [46] [47] [48] [49] 
Martins-MacBook-Pro:~/Documents/cs4215/slides henz$ ps2pdf slides_01.pdf
Martins-MacBook-Pro:~/Documents/cs4215/slides henz$ ls
slides_01.aux          slides_01.log          slides_01.pdf          
slides_01.dvi          slides_01.nav          slides_01.toc
slides_01.out           slides_01.tex          
Martins-MacBook-Pro:~/Documents/cs4215/slides henz$ 


It is quite tedious to keep typing in these commands in a shell whenever the input file slides_01.tex changes. To facilitate the process of running such sequences of translators, the make utility was invented. The make utility reads a description of file dependencies and executes specified programs, whenever the time of generation of a file indicates that it is out of date. Traditionally, this description is kept in a file called Makefile.

For example, in order to specify that the program ps2pdf should be run, whenever a file is younger than the corresponding file filename.pdf, the Makefile may include the following code.

	ps2pdf $< $@ 

To run the make utility to produce slides_01.pdf after slides_01.tex has changed, we only need to type

Martins-MacBook-Pro:~/Documents/cs4215/slides henz$ make slides_01.pdf

In the terminology of Lecture 01, the make tool can be seen as an interpreter of the Makefile.

The Makefile used for the slides is available here.

Why Not Simply Use PowerPoint?

This is the question that has been creeping up in your mind while reading this page, hasn't it? Well, there are a number of good reasons why LaTeX is preferrable to WYSIWYG tools such as PowerPoint and Word.

A well-written article on the topic is available here.