Live data from Hacker News

Introduction to Compilers and Language Design (2021)

dthain.github.io

41–50 of 58 posts

Re: Introduction to Compilers and Language Design (2021)

#41
post #35

Earlier quoted context omitted.

Types and Programming Languages (TAPL) by Benjamin C. Pierce. Basically IMO the main differentiator between languages is their type system. It’s basically table stakes now for programming languages to provide generics so users can write their own type-safe containers, and one simply cannot implement this without some theoretical background like TAPL. In contrast you can easily skim Chapter 7, Semantic Analysis and re…

Programming language design is way weirder than any textbook would make you think. For example, the first rule of language design is: "Sandwich Helix." https://xkcd.com/3003/ You'll also want to study how human language evolves, e.g. through "vernacularization," which is the laziness that drives people to create short words and phrases for ideas they need to communicate often. You'll want to learn about the differing…

The last thing to know is why it is hard. It's like you're writing a dictionary for a made up language, Elvish, say. It would be a moderate size task to write a dictionary for Elvish with the definitions for your words all in English. What's hard would be writing an Elvish dictionary all in Elvish. If you change the definition of one word that's easy, but then you need to revisit the whole rest of the dictionary to use the new definition idiomatically.

Re: Introduction to Compilers and Language Design (2021)

#42

According to the introduction, the dragon book is at an advanced graduate level?

Even the preface to the 2006 edition suggest that they think of it as, largely, a graduate level text:

> It takes at least two quarters or even two semesters to cover all or most of the material in this book. It is common to cover the first half in an undergraduate course and the second half of the book -- stressing code optimization -- in a second course at the graduate or mezzanine level.

Re: Introduction to Compilers and Language Design (2021)

#43

Earlier quoted context omitted.

Programming language design is way weirder than any textbook would make you think. For example, the first rule of language design is: "Sandwich Helix." https://xkcd.com/3003/ You'll also want to study how human language evolves, e.g. through "vernacularization," which is the laziness that drives people to create short words and phrases for ideas they need to communicate often. You'll want to learn about the differing…

The last thing to know is why it is hard. It's like you're writing a dictionary for a made up language, Elvish, say. It would be a moderate size task to write a dictionary for Elvish with the definitions for your words all in English. What's hard would be writing an Elvish dictionary all in Elvish. If you change the definition of one word that's easy, but then you need to revisit the whole rest of the dictionary to u…

FYI: You have about two hours to edit your comments. No need to reply to yourself if it's within that window.

Re: Introduction to Compilers and Language Design (2021)

#44
post #5

Took Dr. Thain's compilers class in college! It was the best. He's an excellent instructor, and the course project made me build a working C-style compiler step by step. I think the sample project here is pretty much the project we did; highly recommend following through the entire thing!

Dr. Thain is great!

Re: Introduction to Compilers and Language Design (2021)

#45

Just scannning the table of contents and I don't see any of the major topics of language design. It seems to be more like just "intro to compilers"

What books would you recommend for programming language design? What are the missing topics?

Along with TAPL, I like Essentials of Programming Languages. It's an introductory text going through a series of interpreters each adding new language features and covering alternative ways to implement things or accomplish a goal (an example, it covers various methods of parameter passing like pass by reference or value and so on).

Re: Introduction to Compilers and Language Design (2021)

#46

Earlier quoted context omitted.

Probably by design. > This book offers a one semester introduction [...] enabling the reader to build a simple compiler that accepts a *C-like language*

Then it is really not about language design... I would rather recommend https://www.plai.org/

Also Practical Foundations for Programming Languages by Harper.

Re: Introduction to Compilers and Language Design (2021)

#47
I don't know if any courses have referenced it yet, but I think C4 (https://news.ycombinator.com/item?id=8558822) and C4x86 (https://news.ycombinator.com/item?id=8746054) would make for a great semester's worth of study; it's a tiny, self-compiling C-subset compiler that would probably make a good base for further exercises in extending it.

Re: Introduction to Compilers and Language Design (2021)

#48

According to the introduction, the dragon book is at an advanced graduate level?

Dragon book is a weird one. While a classic, it only decently covers basics of the theory of computation, while only doing a brief run through the rest of compilers. None of modern grad-level compiler topics are decently covered. The dragon is also not a very practical book. Tiger book is a much better introductory read, balancing between practical and theoretical aspects. Most truly advanced compiler topics are not…

What's the "tiger book?"

Re: Introduction to Compilers and Language Design (2021)

#49

Earlier quoted context omitted.

Dragon book is a weird one. While a classic, it only decently covers basics of the theory of computation, while only doing a brief run through the rest of compilers. None of modern grad-level compiler topics are decently covered. The dragon is also not a very practical book. Tiger book is a much better introductory read, balancing between practical and theoretical aspects. Most truly advanced compiler topics are not…

What's the "tiger book?"

https://www.cambridge.org/core/books/modern-compiler-impleme...

Also versions in C and Java.

Re: Introduction to Compilers and Language Design (2021)

#50

Earlier quoted context omitted.

If you don’t mind me asking, why and how did you make the switch? Going from webdev to compilers seems like a strong U turn that’s not easy to pull off, especially because the resources on compilers out there are extremely scarce

I've been working full time for like 3 yrs as C# dev + doing higher edu at weekends at the same time and I was about to decide thesis topic. I've been searching for something challenging and found some very random post on programming forums about how compilers are hard etc and decided to give it a try. I had kind of advantage that I accidentally had some significant amount of experience with handwritten parsers (at f…

Very cool story. I'm interested to do a similar transition, though I was thinking it would be mecessary to go back and do a masters. It's interesting that that might not be required
Post reply on HN