Introduction to CPS 499/592: Emerging Languages

Introduction to CPS 499/592: Emerging Languages

  • ``If you give someone fish, he can eat for a day. If you teach someone to fish, he can eat for a lifetime'' (foreword to [TSS]).
  • This class is for the student who enjoys problem solving and exploring new ways of thinking and new systems which supports those views.
  • We are going to study and program in languages that may be beyond anything you may have ever seen
  • Why? relationship between languages and the capacity to express ideas about computation; ``it is widely believed that the depth at which we can think is influenced by the expressive power of the language [though] which we communicate our thoughts'' [COPL6] (Sapir-Whorf hypothesis) (e.g., programming team example: ``I can't think genetic algorithms in C++'')
  • like taking a course in Latin

  • Preliminaries (to be read on your own)

    Rather than following prescribed procedure and discussing course description and objectives, I prefer to discuss my approach to this course and what I expect from you. Perhaps at the end of this lecture we will discuss course objectives. We will also discuss these (again) at the end of course so you can reflect on where you have been and what you have learned.

    • This is not a required course. If you are taking this course only to fulfill a breadth requirement and you do not have a scientific curiosity or passion for languages, I recommend against taking the course as this will not be a fun experience for you.

    • This is an extremely challenging course and the workload is tremendous because understanding the philosophy, psychology, and organization of languages, like anything good in life, does not comes easy; it takes work (see evaluation table). I assign intense, but intellectually rewarding, programming assignments in this course.

      You will be asked to solve problems that you have never seen in class. What I am really trying to teach and evaluate in this course is how well you can apply what you have learned/studied in a completely new domain. This is a hallmark of a intelligent person---how well one can think independently to adapt prior knowledge to a new situation or, in other words, to create.

      This most likely will be one of your most difficult CPS courses. However, it is also can be one of the most exciting and eclectic.

    • This course is not learn C# in 21 days or ASP.NET for Dummies. However, what you learn in this course will be endure the test of time and be relevant far beyond the time the flame of any of these cutting edge languages burns out. A guy named Paul Graham built a product called Viaweb based on the ideas presented in this course and sold it to Yahoo! for several million dollars; it became the Yahoo! store.

      The best analogy I can make is: this course is like learning Latin; it is not spoken anywhere, but most smart people know it and it will help you become stronger in your own language as well as better able to learn new languages with ease.

    • I not telling you any of this to scare you. I am telling you this so you know exactly what you are getting yourself into and so there are no misconceptions about the course and my expectations of you. The situation I am trying to avoid at all costs is a student takes this course with no interest in languages and hacks their way through the first 2-3 programming assignments with Cs or Ds. Then that student finds thyself in mid-March when it is too late to drop the course and the student does not know how to use LISP and has no interest in learning it. This is a recipe for disaster.

    • So then why take the course? Because the course is awesome! I love teaching this course because programming languages is my area of research interest and I am eager to share my expertise with you. This course is for the student who enjoys being challenged to look at the world/computing in radically different ways. It is for the student who enjoys exploring new ways of thinking and new systems which support those views.

      I integrate aspects of philosophy, psychology, art and architecture, and literature with computer science in this course. I am going to expose you to a very different view of computation (we are going to write programs in languages which do not have variables!). My goal is to topple your whole view of your field, examine the pieces, and put them back together for you in a different way. Like learning anything, in the beginning you often learn things the wrong way just to get started (e.g., basketball analogy). I am not saying what you learned in CPS 151 and CPS 350 is not important. On the contrary, those topics are very important or CPS 350 would not be a pre-requisite for this course. However, what I am saying is that in this course we are going to look at those topics from different perspectives (e.g., see conduits diagram below). In that sense this course will tie several loose ends together to give you a more holistic view of your discipline. I hope there will be several epiphanies for you in this course. I hope you are as mystified as I was the first time I studied this material. This course has the potential to be the most exciting and interesting course you have ever taken.

      Our field is constantly evolving, and at a pace much more rapid than other fields. We constantly have to re-invent ourselves. If you have a solid foundation, you can do that with ease. My goal is to give you that strong, holistic foundation in this course. However, if your foundation is brittle, you will find adaptation to be a challenge.

      ``If you give someone fish, he can eat for a day. If you teach someone to fish, he can eat for a lifetime'' (foreword to [TSS]).

    Overview of lecture

    So why explore new ways of thinking?

    Scientific discoveries are rarely incremental (goes to heart of idea of paradigm shift). This is especially important for startups. If you are doing the same thing as the next guy, you both are going to be crushed by Microsoft.

    In psychology it is widely believed that one's capacity to think is limited by the language in which one communicates one's thoughts (Sapir-Whorf hypothesis).

    ``I can't think genetic algorithms in C++.''

    Mergesort non-recursively anyone?

    Because languages influence thought and capacity for thought, programming languages are (perhaps, so far) your only conduit into the field of computing, which encompasses a lot more than just languages. Thus, the study of languages envelops the entire field of computing.

    remembering numbers example; Miller's law

    Thus, languages are important. Before we can study languages we have to know what they are

    Fundamental questions:

    • what is a language?
    • what is a program?
    • what is a programming language?
    • what is a programming language concept? usually has options (e.g., automobiles analogy)

    To be able to study emerging languages, we have to learn the fundamentals of languages, and build a toolkit and vocabulary for comparative study, and that means learning LISP. The ideas in LISP provide the foundation of the emerging languages we will study in this course. Why LISP?

  • Latin to natural languages analogy.

    ``If you give someone Fortran, he has Fortran. If you give someone LISP, he has any language he pleases'' (afterword to [TSS]).

    We are going to demonstrate how to add recursion to a language that does not support recursion.
    We are going to study how to add threads to a language that does not support multiple threads of control.

    We will spend about a month on this.

    What influence language design?

    Languages evolve. Based on what?

    There is shift in modern times toward more dynamic languages. Why?

    Static vs. dynamic bindings in languages (e.g., the times of our life analogy, birth, life, and so on).

    • Oil painting example from student:
      ``If this looks like I just barfed code across half a dozen files, it's probably because I did. Which is why I chose Python, as Python is a great language for just throwing down pseudocode without getting everything exactly planned out right ahead of time.''
    • Writing generates thoughts (e.g., grocery list).
    • Throwaway prototypes (e.g., interviewing example---use it to figure out what we are looking for in a candidate).

    Along the way we will comparitively study programming language paradigms, which are the CS analogs to families of natural languages, and the use of representative languages, such as Haskell, PROLOG, and Smalltalk. Thinking in one and coding in another is akin to thinking in English and speaking in Chinese (i.e., it will not work!). The languages we are going to study, especially LISP and Smalltalk, encompass the foundational blocks for the concepts we study.

    What is a paradigm?

    What is a programming language paradigm?

    What are the four main language paradigms?

    Purity in language paradigms.

      Is Java a pure OO language?

      Is C++ a pure OO language?

      Is Scheme a pure functional language?

    Evolution of programming languages ... blurred distinctions; multi-paradigm languages

    We need to develop a vocabulary for comparative study:

    • What is a language, program, programming language, language concept?
    • What is a static/dynamic property?
    • What is a side effect? (expressions vs. statements)
    • What is referential transparency?
    • What is a first-class entity?
    • Are objects first-class in C++? Java?
    • Are functions first-class in functional languages?
    • Language evaluation: readability, writability, reliability, cost

    Course themes
    (These will recur often. I will ask you often of which themes in-class examples are an instance.)

    • relationship between languages and the capacity to express ideas about computation
    • static (rigid and fast) vs. dynamic (flexible and slow) properties
    • cost of execution vs. cost of development
    • speed of execution vs. speed of development
    • simple, small, consistent, and powerful languages (LISP, Smalltalk) vs. complex, large, irregular, and weak languages (so called kitchen-sick languages, e.g., C++)
    • languages evolve: the influence of language design and implementation options on current trends in programming practice and vice versa (iPod, GPS in car)
    • shift in modern times towards more functional, dynamic languages (speed of execution is less important as a design goal as it once was)

    Why bother?

    • improve background for choosing appropriate languages and learning new languages and technologies
    • some things cannot be expressed as easily in certain languages (e.g., déjà vu in English, ref. Charlie Suer, Fall 2010)
    • increase capacity to express ideas about computation (thinking out of the box)

    • to become a well-rounded computer scientist and a better programmer, in any language


      [COPL6] R.W. Sebesta. Concepts of Programming Languages. Addison-Wesley, Boston, MA, Sixth edition, 2003.
      [TSS] D.P. Friedman and M. Felleisen. The Seasoned Schemer. MIT Press, Cambridge, MA, 1996.

    Return Home