Live data from Hacker News

Let’s Build a Compiler (1995)

compilers.iecc.com

11–20 of 58 posts

Re: Let’s Build a Compiler (1995)

#11

This series is one of the best introductions to compiler construction. It doesn't cover everything and it's 25 years old now, but it is the only guide I know of that will hold your hand as you build a working compiler from scratch. If you have never built a compiler before, I cannot think of a better place to start. Afterward, if you're curious about theory and advanced topics, I recommend heading to Compilers: Princ…

A port of it to Python would probably be a better place to start. Not many people are conversant in Pascal these days.

It's easy enough to follow along. The snippets are simple enough that anyone who knows a procedural language won't have trouble understanding what they do, and from there it's pretty trivial to write the equivalent code in another language. You can get pretty close by writing C with a few helper functions.

Re: Let’s Build a Compiler (1995)

#12
post #9

Email me if you'd like an HTML version of this. I have converted most of it for my own personal use (through part 11, IIRC) but don't want to distribute it publicly since I'm unclear on the copyright status.

Isn't this kindof "publicly"?

Yes, let's turn this into a semantic debate. Much more fun and productive.

Re: Let’s Build a Compiler (1995)

#13
post #4

I went through this on my own back in a HS programming class! Glad to see it here. While the teacher was walking students through how to do loops, I got permission to hack away in the back of the room on this. I ended up building a BASIC-like interpreter with a decent graphics API. By the end of the class, my project was a multi-level breakout game I'd written in the interpreter I'd written. TLDR; two years later, I…

How long did it take you to get through it?

Re: Let’s Build a Compiler (1995)

#14

This series is one of the best introductions to compiler construction. It doesn't cover everything and it's 25 years old now, but it is the only guide I know of that will hold your hand as you build a working compiler from scratch. If you have never built a compiler before, I cannot think of a better place to start. Afterward, if you're curious about theory and advanced topics, I recommend heading to Compilers: Princ…

This is more specific to C, but can still be applied to other areas. I always thought it was a great read. A Retargetable C Compiler: Design and Implementation

https://sites.google.com/site/lccretargetablecompiler/

Re: Let’s Build a Compiler (1995)

#15

Email me if you'd like an HTML version of this. I have converted most of it for my own personal use (through part 11, IIRC) but don't want to distribute it publicly since I'm unclear on the copyright status.

I suggest you contact the IECC. They should be able to provide guidance on what you can share and how. It's old enough that they might allow separate hosting provided you link back to their site.

Re: Let’s Build a Compiler (1995)

#16

This series is one of the best introductions to compiler construction. It doesn't cover everything and it's 25 years old now, but it is the only guide I know of that will hold your hand as you build a working compiler from scratch. If you have never built a compiler before, I cannot think of a better place to start. Afterward, if you're curious about theory and advanced topics, I recommend heading to Compilers: Princ…

I just looked at the chapters, and it's kind of funny that it gets these accolades despite being written as a 80-char-width text-only file.

Edit: I don't say that to disparage it; I actually think that's an impressive accomplishment.

Re: Let’s Build a Compiler (1995)

#17
post #9

Earlier quoted context omitted.

Isn't this kindof "publicly"?

Yes, let's turn this into a semantic debate. Much more fun and productive.

It's not a purely semantic question - "in what way is announcing that you're distributing better than visibly distributing?" - I can think of a couple.

Re: Let’s Build a Compiler (1995)

#18
post #4

I went through this on my own back in a HS programming class! Glad to see it here. While the teacher was walking students through how to do loops, I got permission to hack away in the back of the room on this. I ended up building a BASIC-like interpreter with a decent graphics API. By the end of the class, my project was a multi-level breakout game I'd written in the interpreter I'd written. TLDR; two years later, I…

How long did it take you to get through it?

Well, it was about 20 years ago and I was a self taught programmer pre-Internet days. I actually downloaded it from a BBS and had no outside references to work with.

I spent probably 30 minutes 2 or 3 times a week for a couple of months. Most of that was probably adding features to my interpreter and coding the game itself. I recall it being extremely clear to me, even without any sort of formal CS. Even things like working with the stack and recursion were clear to me at the time.

Re: Let’s Build a Compiler (1995)

#19

This series is one of the best introductions to compiler construction. It doesn't cover everything and it's 25 years old now, but it is the only guide I know of that will hold your hand as you build a working compiler from scratch. If you have never built a compiler before, I cannot think of a better place to start. Afterward, if you're curious about theory and advanced topics, I recommend heading to Compilers: Princ…

There is a class about compilers on coursera [1] which should be pretty good and more up to date.

[1] https://www.coursera.org/course/compilers

Re: Let’s Build a Compiler (1995)

#20

This series is one of the best introductions to compiler construction. It doesn't cover everything and it's 25 years old now, but it is the only guide I know of that will hold your hand as you build a working compiler from scratch. If you have never built a compiler before, I cannot think of a better place to start. Afterward, if you're curious about theory and advanced topics, I recommend heading to Compilers: Princ…

I've seen Engineering a Compiler get recommended as well, have you read that one?
Post reply on HN