Lecture 1: Studying Programming Languages

 

 

What you'll learn

A large portion of this course teaches you how to take input in form of some existing program in text form, turn it into the appropriate data structures, and then use those structures to compute a result. A simple example of this would be reading a mathematical expression and calculating a final value from it by successively reducing terms. Many of the more advanced issues like order precedence, intricacies of grammars, how to do lexical analysis fast, etc. will not be dealt with in this class. You can find out more in COMP 412, the introductory compiler class.

The concepts and skills you will learn in this early portion of the course are already enough to augment many of your programs with customly designed programming languages, making them more flexible and extensible. Emacs, for example, contains an extensive Lisp programming environment that lets the user automate and extend virtually any aspect of Emacs. If you like, you can read your email in Emacs. While a language facility like this with its bindings to the outside world is somewhat complex, it will not be out of your reach anymore.

In the second portion of the course, we will turn more to analyzing a program. Instead of just reducing it to a final result, we can actually prove certain things about the programs entered, for example that it does not violate some constraints. If we add type information to our language, we can prove that the program makes sense, at least from this type perspective. We can state without a doubt that a situation like adding a numerical value to a boolean will never occur. Once we add references (think pointers), we can also prove that a program will not make memory accesses that are out of control. Interestingly, you will find that for these analyses, you can employ techniques similar to the ones you have already used for the reduction of a program to a result. Improving type and memory safety in commercial languages is still a very active area. Java just added generic types to the language, a feature which many of you will use if you decide to write your projects in Java. The way in which these generic types were added still leaves a lot to be desired, and solutions to improving the type safety and expressiveness of Java are still developed, here at Rice, for example.

In the third portion of the course, you will learn how to make some changes to programs so that they can be represented more efficiently. After these transformations, a program might require less memory or have nicer properties regarding recursion. It is also easier to implement the interpreter in a low-level language or Assembly once these transformations are in place. This is actually a large step in the direction of a compiler already, a subject that is extensively covered in COMP 412.

Why you should want to learn that

Studying programming languages is important for many reasons. In the past few years, several new languages have emerged, and even become dominant in a few cases, and each of these languages is targeted at a particular technological niche. Think of Java, C#, XML, and Perl, for example. To make effective use of technology, you have to master the language that controls the technology.

New programming languages are constantly being invented. The proliferation of languages has made it especially important to understand the design and properties of languages. In particular, many technologies already have languages designed to address them; the user only needs to find the appropriate language. Having studied programming language, it is likely that you will have to expend less energy in the future.

Understanding programming language concepts is key to better program design. A grasp of programming language principles enables the programmer to explore a much larger spectrum of possible programming techniques for solving a given computational problem and to assess the tradeoffs among them. You might also have to choose a programming language for some project in the future. Making such a selection involves several issues, including technical, sociological, economic considerations. In this course, we will focus primarily on technical considerations because they are more universal and more enduring. Finally, you might be asked to design a new language as part of writing a particular software application. To be successful, you must understand the conceptual building blocks used to construct programming languages.

While you may never have the task of creating "the new C++" or "the new Scheme", the information you can learn in this class will probably be helpful more often than you think, not only in computing something, but also in creating a small new language to fill some niche, extending programs by adding a programming language, and in just using existing programming languages.

Back to course website