This page is an introduction to my book Modern Programming Languages: A Practical Introduction, which is now in its second edition. I hope you will find it useful; there is contact information at the bottom of the page.

From the Preface

This book introduces the concepts of diverse programming languages for students who have already mastered basic programming in at least one language. It is suitable for use in an undergraduate course for computer science and computer engineering majors. It treats all the knowledge units in the area of programming languages that appear in the ACM’s Computer Science Curriculum 2008, and introduces the core units thoroughly. It gives programming exercises in three different language paradigms. Philosophically, it is in complete agreement with the ACM report, which emphasizes this new recommendation in section 3.2.4:

Computer science professionals frequently use different programming languages for different purposes and must be able to learn new languages over their careers as the field evolves. As a result, students must recognize the benefits of learning and applying new programming languages. It is also important for students to recognize that the choice of programming paradigm can significantly influence the way one thinks about problems and expresses solutions of these problems. To this end, we believe that all students must learn to program in more that one paradigm.

This book has two distinct kinds of chapters: practical and theoretical. The practical chapters are self-contained primers in three very different programming languages—ML, Java, and Prolog—at least two of which will be new languages for almost all students at this level. Students receive a quick introduction to the linguistically unique parts of each language, and enough simple programming exercises to develop a feel for the programming paradigm of the language. There are excellent free implementations of all these languages available on a variety of platforms, including Windows, Unix, and Macintosh; the book’s Web site has instructions on how to get them.

The theoretical chapters present the underlying principles of programming languages. They are interleaved with the practical chapters in an order that allows ideas to be illustrated using examples in the newly learned languages and allows theoretical topics to be covered when their relevance to programming practice will be most evident. For example, Chapter 23 deals with formal semantics by starting with simple interpreters written in Prolog. These interpreters lead naturally to language definitions using big-step operational semantics. That is why formal semantics occurs so late in the book: only at the end of the Prolog tutorial are students ready to be led from Prolog exercises to this related, abstract topic.

The book is written at an introductory level. It is meant to be comprehensible (and interesting!) for most students who have completed a basic CS1/CS2 sequence using any language. A common defect in other books on this subject is that they assume too much: more computing background, more mathematical maturity, and more native interest in abstraction and categorization than most students in the target audience actually have. It is very tempting to make such assumptions, since many interesting parts of programming language theory are not accessible to students at this level. But it does not serve the majority of the students well. There is more than enough material for a semester, without resorting to topics that require a knowledge of computer architecture, operating systems, formal languages and automata, mathematical logic, or inductive proof techniques. A course using this book need not be placed at the end of a long chain of prerequisites. This makes it useful in a wide variety of CS/CE curricula.

Because of its narrative, tutorial-based organization, the book is easy to teach from when followed in order, as far as time allows. If students already know one of the languages (most likely Java), several of the tutorial chapters may be skipped or skimmed, making room for more in-depth coverage of others or for the introduction of additional material. If additional chapters must be skipped, the most important chapter dependencies are, roughly, as shown in the following table:

Chapters It Depends On
1: Programming Languages
2: Defining Program Syntax
3: Where Syntax Meets Semantics 2
4: Language Systems
5: A First Look at ML 2, 3
6: Types 4
7: A Second Look at ML 2, 3, 5
8: Polymorphism 4, 6
9: A Third Look at ML 2, 3, 5, 7
10: Scope 4
11: A Fourth Look at ML 2, 3, 5, 7, 8, 9
12: Memory Locations for Variables 4, 5, 7, 9
13: A First Look at Java 2, 3
14: Memory Management 2, 3, 13
15: A Second Look at Java 2, 3, 13
16: Object Orientation 2, 3, 5, 7, 9, 13, 15
17: A Third Look at Java 2, 3, 13, 15
18: Parameters 2, 3, 13
19: A First Look at Prolog 2, 3
20: A Second Look at Prolog 2, 3, 19
21: Cost Models 2, 3, 4, 5, 13, 19, 20
22: A Third Look at Prolog 2, 3, 19, 20
23: Formal Semantics 2, 3, 4, 5, 7, 9, 10, 12, 19, 22.2
24: The History of Programming Languages Miscellaneous

In particular, Chapters 11, 14, 21, and 22 can be skipped without much damage to the others. If time presses at the end of a semester, it would be better to skip Chapters 21 and 22 (except 22.2) rather than Chapter 23 or 24. Chapter 23 revisits and illuminates many important ideas from earlier chapters. Chapter 24 is at the end not because the history of programming languages is unimportant, but because it is more interesting when students understand some of the concepts whose history is being related.

This basic organization served well in the first edition of the book, and the second edition has not deviated from it. But the second edition has been updated in many ways, and there are changes to every chapter. In some chapters the changes are minor: for example, there are repairs to some fifty errata reported by readers of the first edition. In other chapters the changes are more significant. For example, all the ML, Java, and Prolog examples and exercises have been re-tested and modified as necessary to reflect current versions of the languages:

  • Standard ML of New Jersey, Version 110.70
  • SWI-Prolog, Version 5.8.3
  • Java, JDK 6.0 Compliant

Java in particular has grown significantly since the first edition in 2003. Some of the additions to Java are in areas too advanced to affect this book, but others are of importance even to beginners. The first edition speculated on how parametric polymorphism might be added to Java; this edition gives examples of how it has been added to Java in the form of generics. Development of the SWI-Prolog system has also been significant, and it now conforms more closely to the ISO standard. The first edition avoided introducing the cut construct in Prolog; this edition does introduce it, in a limited way, and uses it in several examples and exercises.

Contact Information

The book is published by Franklin, Beedle & Associates (ISBN 978-1-59028-250-2). You can go to the publisher’s Web site to order the book or to obtain a review copy. Or call them toll free in the USA; their phone number is 1-800-322-2665. Should you be calling from outside the USA, the number is 1-503-284-6348. The company’s address is:

Franklin, Beedle & Associates, Incorporated
2154 NE Broadway, Ste. 100
Portland, OR 97232

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>