Live data from Hacker News

Writing an Interpreter in Go: The Paperback Edition

thorstenball.com

51–60 of 78 posts

Re: Writing an Interpreter in Go: The Paperback Edition

#51

Earlier quoted context omitted.

It's a AST walking interpreter, completely built from scratch, including the lexer, the parser, the AST and, of course, the walking/evaluation step.

Cool, asking because the level _past_ the AST walking is where I'm at personally in my learnings. I feel most treatments stop at the AST interpreter step, which is what most people see in school already. I wish there was equally good treatment for everything that comes after that. Type systems, bytecode generation, JIT, optimization phases, etc.

Part of this should be covered by the upcoming chapters of http://www.craftinginterpreters.com/

Re: Writing an Interpreter in Go: The Paperback Edition

#53

Earlier quoted context omitted.

It's a AST walking interpreter, completely built from scratch, including the lexer, the parser, the AST and, of course, the walking/evaluation step.

Cool, asking because the level _past_ the AST walking is where I'm at personally in my learnings. I feel most treatments stop at the AST interpreter step, which is what most people see in school already. I wish there was equally good treatment for everything that comes after that. Type systems, bytecode generation, JIT, optimization phases, etc.

I'm not sure if this is what you're after, since it's not really in book form, but I've learned a lot about advanced language implementation from reading the Rust RFCs [1], especially those relating to MIR. Between the discussion on each PR and the resulting implementation in the actual compiler, it makes some very complicated subjects more relatable than they normally would be. I'm really grateful that so much of Rust's development happens in such an open fashion.

[1] https://github.com/rust-lang/rfcs

Re: Writing an Interpreter in Go: The Paperback Edition

#54
post #19

Earlier quoted context omitted.

The best learning outcomes for the author I believe. But I'm more interested in the prospective reader's PoV.

I recently read a comment (I think it might have been on HN, but I can't find it) that said something like this: if you recently learned/mastered a topic, you're in a far better position to teach that topic than an expert, who's so deep into it, that they can't understand the beginners. I wish I could find the source for this, because it was much better put, but that comment contains the gist of my motivation behind…

> if you recently learned/mastered a topic, you're in a far better position to teach that topic than an expert

That can work, assuming that (1) the particular difficulties you encountered will generalize to most other learners and that (2) being good at programming equates to being good at pedagogy.

>I recently read a comment (I think it might have been on HN, but I can't find it)

I think it probably was on HN.

Re: Writing an Interpreter in Go: The Paperback Edition

#55
post #47

Are createspace books still of a noticeably lesser quality printing than non-print-on-demand books? I saw a few a while (a few years?) ago, and the quality offended me, so I wrote off createspace. I'd be interested to learn that's not the case anymore. (Just to preemptively clarify: The bad quality I mentioned was most noticeable when compared to a non-POD book. On its own, it looks OK-ish and you might not think any…

I used CreateSpace for a hardback book seven years ago (LaTeX → PDF), and it came out very, very nice. Absolutely no complaints.

Was your experience with their paperbacks or hardbacks?

Re: Writing an Interpreter in Go: The Paperback Edition

#57
post #55
post #47

Are createspace books still of a noticeably lesser quality printing than non-print-on-demand books? I saw a few a while (a few years?) ago, and the quality offended me, so I wrote off createspace. I'd be interested to learn that's not the case anymore. (Just to preemptively clarify: The bad quality I mentioned was most noticeable when compared to a non-POD book. On its own, it looks OK-ish and you might not think any…

I used CreateSpace for a hardback book seven years ago (LaTeX → PDF), and it came out very, very nice. Absolutely no complaints. Was your experience with their paperbacks or hardbacks?

Given that it was a few years ago, I can't be certain, but I'm pretty sure I only saw paperbacks.

Re: Writing an Interpreter in Go: The Paperback Edition

#58
post #47

Are createspace books still of a noticeably lesser quality printing than non-print-on-demand books? I saw a few a while (a few years?) ago, and the quality offended me, so I wrote off createspace. I'd be interested to learn that's not the case anymore. (Just to preemptively clarify: The bad quality I mentioned was most noticeable when compared to a non-POD book. On its own, it looks OK-ish and you might not think any…

I'm actually really surprised by the quality. I expected, as you put it, "non-print-on-demand" quality, but what I got has no obvious flaws or defects and a really high quality feel to it.

Re: Writing an Interpreter in Go: The Paperback Edition

#59

Is the complete version on Github somewhere? (I just want to skim through the source code.)

I haven't uploaded the code to Github myself, but as of v1.3 of the book the code is MIT licensed. That means there are a lot of implementations floating around, either copied straight from the book or adapter to another language. Here's the repo of a reader who followed the book closely in Go: https://github.com/RyanBrushett/interpreter
Post reply on HN