Principles of Programming Languages - CSCI 3155 - Fall 2024
Professor Bor-Yuh Evan Chang
Suppose you want to run lots of JavaScript programs — all the cool kids are doing it, but unfortunately you have a computer that can only execute x86 assembly. So you decide to write a compiler from JavaScript to x86 assembly.
Furthermore, suppose that you think Scala is the best language for writing a compiler; you find the language has particularly effective constructs for implementing compilers. Unfortunately, your computer only has a C to x86 compiler. Having taken 3155, you know that you can write an awesome compiler in Scala that produces efficient x86 code, but you’re not so sure you can write an efficient compiler in C. What do you do?
Idea: Bootstrapping
Key Terms: A meta language versus an object language.
A programming language is
A program is
Syntax is
Semantics is
An interpreter is a program that executes other programs.
An interpreter is written in a meta language (also called an implementation language) that interprets programs in an object language (also called a source language).
A compiler is a program from one object language (the source language) translating a program in another object language (the target language).
Principles of Programming Languages - CSCI 3155 - Fall 2024
Professor Bor-Yuh Evan Chang
“I, …, wonder …”
Let’s turn off our cell phones and laptops.
Just imagine that we have class in Rocky Mountain National Park.
If you have a need to use a laptop, please discuss with me after class.
Introduce yourself to someone you haven’t met before.
Two minutes!
Build interpreters for mini-languages.
2-3 weeks of active discussion — in class and online (Piazza) — towards incrementally completing a lab! Do intermediate assignments along the way.
Recitation sections are lab sessions. Bring a laptop.
Assignments due Friday 6pm. Everyone gets an automatic “stuff happens” 24-hour grace period.
No late assignments but generous “redo” policy and lowest score dropped.
Please interrupt at any time!
It’s completely ok to say, “I don’t understand. Please say it another way. Slow down!”
Attempting assignments and reading before class prompts the discussion. There is an expectation on you to be active.
Why study PL?
Why study PL when we have ChatGPT?
Come on Thursday to hear from 3155 alumni!
This is not a history course.
You will need to learn many languages during your careers.
You will learn concepts that make it easier for you to learn new languages in this class.
Have you ever had to pick a language?
What criteria did you use?
How do you understand “about pages”?
Have you heard of Google MapReduce?
How about Meta React?
… inspired by ideas from PL theory
What does it mean for two programs to “behave the same”?
You will be able to reason about computation.
Being able to compute versus being about to reason about computation is very different (analogy: arithmetic versus algebra).
Distinguishes between learning activities:
And summative assessments: