r/ProgrammingLanguages • • 8d ago

Help Help with resources for learning

Hello everyone. I have learning about programming languages and compilers for over a year now and I have struggled finding useful resources for learning advanced topics.
I find things like type theory hard to follow (it’s not really the math, just that most resources don’t take the time to explain the implications of the theory in actual language design).
I have taken a look at crafting interpreters and the dragon book and have found them good resources but I wanted to know if there is any good central resource to deepen my understanding.
Thanks for taking the time!

6 Upvotes

11 comments sorted by

2

u/mamcx 8d ago

What topics are you looking for?

1

u/santi34mg 7d ago

Right now I think it is type theory and type systems but in general any good resource about programming languages. The resources that people have provided so far seem very promising!

2

u/samanzaman 6d ago

Lot of great resources are mentioned in the replies already from TAPL to Zoo. I'd also suggest to write a small Prolog interpreter. It is surprisingly useful

11

u/GiveMe30Dollars 8d ago edited 7d ago

Disclaimer: after following Crafting Interpreters and making Lox twice, I jumped off the deep end by attempting to make a Haskell subset compiler. It's still ongoing and is likely to be so indefinitely lol. My focus is more towards type systems and semantic analysis + optimization rather than compiler frontend + backend.

This resource gives a quick overview on how to read the typing rules you see everywhere in these papers.

Typechecker Zoo is the crash course I took for understanding some common type systems. Don't worry if you don't understand everything at first! Take your time chewing through it. Start with the typed lambda calculus (Algorithm W) then System F. This would probably give you enough background to start learning about type systems independently.
(It's grown quite a bit since I last read it! Neat as the "starting page" if you want to get into any of the following topics.)

Thunderseethe's Making a Language is another end-to-end language implementation similar to Crafting Interpreters, with more focus on semantic analysis and optimization than the frontend + backend of a compiler. You may find it an approachable read.

7

u/SalubriousInsoucianc 8d ago

Types and Programming Languages by Pierce is my reference. Christiansen’s Bidirectional Typing Rules paper very short.

Programming Languages: Application and Interpretation is the most rewarding PLT text I’ve worked through. No focus on types or compilers that I recall. Not sure how to describe it. You’ll never again say a language is compiled or interpreted, for example.

2

u/AustinVelonaut Admiran 7d ago

Here is a list of resources I found useful when implementing my language, (although many of them are more focused on implementing functional languages).

2

u/drinkcoffeeandcode mgclex, mgcpgen, & owlscript 2d ago

The following books have proven absolutely invaluable to me whilst learning about compiler and language design

(Title, author(s))
Crafting a compiler, Fischer and LeBlanc
Compiler construction, Louden
The Dragon Book, Aho, Sethi, Ullman
Modern compiler implementation, Appel
Language implementation patterns, Parr
Programming Languages Concepts and Constructs, Sethi
Programming Language Pragmatics, Scott

You’re also going to want a good resource on data structures.

2

u/Public_Grade_2145 7d ago

You should try the book "Essentials of Programming Languages" by Daniel P. Friedman and Mitchell Wand. It is great. It compares the implications of introducing feature by writing several interpreters. Though, it is less theoretic as compared to TAPL.

One example from the book, consider 2 procedure parameter passing methods.

  • call-by-value
  • call-by-reference

Call-by-reference is useful in implementing functions that mutates the arguments like swap, which is impossible in pure call-by-value languages. EOPL has an exercise ask you to implement the language such that it is call-by-values with some benefits of call-by-reference, allowing writing swap function. Actually, this motivates pointer construct.

1

u/drinkcoffeeandcode mgclex, mgcpgen, & owlscript 2d ago

Sure you’re not confusing call by name?

1

u/Public_Grade_2145 1d ago

Call by name is delaying argument evaluation until needed; it is lazy evaluation. Call by value is eager evaluation.

There are two concepts conflating here: parameter binding and evaluation. CBN and CBV are more about evaluation strategy.

Call-by-reference passes addresses of variables being used as parameters. (i.e.: C++ void swap(int &x, int &y)). Call-by-value copy the values of arguments instead.

1

u/L8_4_Dinner (Ⓧ Ecstasy/XVM) 7d ago

Project "Simple" by Cliff Click, et al: https://github.com/SeaOfNodes/Simple