Why Study Programming Languages?
I got the following question in my Programming Languages class: "How do the ideas presented apply to computer science and software engineering?"
Here are my answers to that questions with specific topics covered in CS 345 in mind:
As a tongue-in-cheek answer, first: this is Computer Science.The first Turing award and the second-to-last-one so far (in 2020) are awarded for PL research, with many in between. Software Engineering is just another discipline in Computer Science, so it is taught in a different course.
I laid out the overall motivation for the ideas in the course in Lecture 1, the slides go over why we care about studying PL. The biggest ones are that you will:
- have a critical eye towards how language implementations work,
- be able to reason about your programs step-by-step more rigorously, and
- be able to design small languages when they are necessary to solve a problem.
Here are the motivation for the topics overall. You'll notice that all of these are tools for thought:
- Haskell and functional programming
- makes the rest of the course easy. Also, it is a new way of writing programs with unique advantages such as composability, not thinking if changing the order of function calls matter, etc.
- we need to look at the structure of programs so that we can ascribe meaning to them.
- Formal logic
- it is a sound foundation upon which we build all our concepts. Also, it is related to how some type systems came to be.
- Lambda calculus
- this is one of the foundations of the theory of computation, which you should learn as a computer scientist. It also serves as a tiny language to try out ideas about semantics and types before we deploy them on our in-classroom language.
- Formal semantics
- all other approaches to semantics are less clear or ill-defined. Also, this allows us to specify what our programs should do so that we can reason about them: prove correctness of programs, write interpreters, etc.
- Type systems
- you use types as a programmer, but there are lots of misconceptions about types. That's why we are having the current writing assignment, so you can understand how type checking works, and what it buys you as a programmer. Type systems will let us have a rigorous framework to reason about well-behaving programs, and show practical implications of the fundamental limitations of computability.
- Logic programming
- Yet another "paradigm" of programming. It also connects logic to programming languages. We will look at it in isolation, but you would compose it with other approaches to programming in practice. For the practically-inclined, it is useful in databases, constraint solving, classical AI, automated theorem proving, etc. (all of these are areas of Computer Science as well). That's also what I use to generate tests for your homework, so it is useful for software engineering.
The first Turing award and the second-to-last-one so far (in 2020) are awarded for PL research, with many in between.