Live data from Hacker News

Writing an Interpreter in Go: The Paperback Edition

thorstenball.com

31–40 of 78 posts

Re: Writing an Interpreter in Go: The Paperback Edition

#31
post #11

So what was the source format? Markdown?

Yes. 5-6 markdown files, converted to epub, mobi, pdf and html with pandoc. I know there are better workflows, especially in regards to embedding code (my approach was simple copy and paste), but if there's one recommendation I can make it's this one: check out pandoc. It's an amazing tool.

Thanks.

Re: Writing an Interpreter in Go: The Paperback Edition

#36
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…

This applies to anything that we as human do, including doctors [0]. Younger doctors that are just out of a residency are more up to date about medical science and have the facts in a fresh memory.

[0] https://www.ncbi.nlm.nih.gov/pubmed/15710959

Re: Writing an Interpreter in Go: The Paperback Edition

#37
post #35

This is really awesome. What I love especially is that the source code is syntax highlighted, I really wish I could have gotten that for my book.

I didn't really think about this that much before, it was more like "yeah, full colors, sure, why not?". Holding the proof copy in my hands I realized what a nice touch it was and that I haven't seen this in other programming books. Of course, the full colors come with a cost, but once I saw it, I couldn't go back to black/white :)

Re: Writing an Interpreter in Go: The Paperback Edition

#38
post #19

Earlier quoted context omitted.

My belief is that writing about a topic that one is trying to come to grips with helps ensure they achieve the best possible learning outcomes.

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

My subjective opinion is that a reader would learn more from a person that went to discover a new topic and wrote down the steps and knowledge acquired along the way. The reader is essentially taking the same steps, learning the same things. If however an expert would write about the same topic, she will have hard time to follow the same pattern.

I believe that J.K. Rowling used the same pattern for her Harry Potter books. She started writing them for children and then each book followed the same kids to their adulthood.

Re: Writing an Interpreter in Go: The Paperback Edition

#39

Anyone can share what sort of interpreter this is? Is it a walking-AST kind of thing, or something more advanced?

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.

Re: Writing an Interpreter in Go: The Paperback Edition

#40
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…

This is credible, but I'd guess that it'd be more accurately restated this way: if you recently learned/mastered a topic, you both have a fresh recall of the elements involved in reaching your level of mastery and what was involved in bridging that (personal) gap between unskilled ignorance and that mastery.

Whether that puts one in a far better position to teach than an expert probably depends on the expert. I definitely had math professors for whom the charge applied, and I'd speculate that an expert who's primarily focused on further mastery/development along the edges of the field might be someone who becomes less and less able to recall or relate to what it's like to take first steps into it. But on the other hand, I had math professors who clearly thought a lot about pedagogy as well as research, and practiced both at length... and I think someone who's spent significant time teaching beginners and reflecting on that as well as practicing their discipline and refining deep insights from that is likely in a better position to teach a topic than someone who just learned.

(And if you really want an optimal learning environment, put a class full of motivated learners in front of a teacher like that, and have them talk to each other. Hence the value of a good university course...)

Post reply on HN