9 ms·
Crafting Interpreters is available in print
- munificent 5y agoAuthor here! It feels amazing to have this done and live. I'm happy to talk about whatever you might want to know about it. If you're curious how the sausage was made, I wrote a blog post about taking the web book and bringing it to print and ebook here: http://journal.stuffwithstuff.com/2021/07/29/640-pages-in-15-months/ http://journal.stuffwithstuff.com/2021/07/29/640-pages-in-15...
- marcocampos 5y agoCongrats man, I love the book and the final physical/PDF book layout/design is amazing!
- munificent 5y agoThank you! It looks really nice in person, if I do say so myself. It's so cool to see the illustrations in full crisp 600 DPI.
- m0meni 5y agoCongrats! Been following you for a while and just finished the blog post...what a huge effort and meticulous attention to detail. I can't wait to buy the book so I can continue to procrastinate reading the full thing in print instead of on my computer monitor
- munificent 5y agoPersonally, I find that I procrastinate so much more effectively in print than on a screen. Being able to hold the material in my hands... and yet still failing to actually do so, really makes a difference.
- m0meni 5y agoThere's nothing like walking around and seeing the constant, physical, and, in the case of this book, beautiful reminder that you're not doing what you want to do.
- mwcampbell 5y agoCongratulations on completing this long journey. I just bought a copy, mostly to reward your effort, but also to satisfy my curiosity on an aspect of how the PDF sausage was made. I notice that the PDF version of the book doesn't include the semantic tags required for accessibility. Now, please don't take this as a criticism; I know that people (like me) who use a screen reader or other accessibility tool can go with the EPUB or online version. But, I wonder, did you consciously decide to turn off tagged PDF, or were you just going with the default in InDesign? Thanks!
- munificent 5y ago> I just bought a copy, mostly to reward your effort Thank you! > did you consciously decide to turn off tagged PDF I did not. I did export an interactive PDF from InDesign and took care to make sure that the table of contents and internal links work, but I have zero experience in PDF accessibility. I'll take a look into it and see what I can figure out.
- mwcampbell 5y ago> I have zero experience in PDF accessibility. You and 99% of people who have ever produced a PDF file, I would guess. Which is why I wish InDesign would do the right thing by default. No big deal for this book since it's available in other formats, and I don't regret purchasing the PDF, but so many other books and documents are made available only as PDF.
- munificent 5y agoThank you for buying a copy. If you prefer to try out the EPUB file to see if that's better, email me and I can hook you up.
- steveklabnik 5y agoCongrats! Can't wait to get my hands on a copy.
- munificent 5y agoI mention you on page 566. :)
- steveklabnik 5y agoWell if I wasn't sold before... ha! <3
- acj 5y agoCongrats, Bob, and thanks for all of your time and effort. I enjoyed the illustration videos that you included in the earlier blog post [1] (under "Illustrating by Hand"). That post landed at a time when many of us were badly stressed, and I remember it being very soothing. [1] https://journal.stuffwithstuff.com/2020/04/05/crafting-crafting-interpreters/ https://journal.stuffwithstuff.com/2020/04/05/crafting-craft...
- ImJasonH 5y agoAgreed. Maybe it was just the April-2020 of it all, but "Writing is Suffering" really hit me in the feels. It's inspiring to see all your hard work reach this milestone, and I can't wait to hold it in my hands.
- mtlynch 5y agoCongrats on the print version, Bob! I appreciate you taking the time to share everything you've learned about the writing and publishing process. I look forward to reading this!
- rednab 5y agoThat's going to look awesome next to my copy of Game Programming Patterns! ... What do you mean "Temporarily Out Of Stock", amazon.co.uk!?
- munificent 5y agoIt should sort itself out soon, I hope.
- rednab 5y agoI'm rather hoping you will sell out your print run, actually. :) But to pile in with everybody else, congratulations!
- munificent 5y agoIt's print-on-demand so selling out should be hard, but I welcome any attempts to overwhelm the system. :)
- a9h74j 5y agoSo that was step 3 all along! Invite DDOS. Step 4: ...
- rgrmrts 5y agoWoohoo, congrats Bob! I’ll be picking up a copy (is there a difference in your cut for Amazon vs Barnes & Noble?) and am excited to work through it. I’ve been referencing the web version here and there but waited on working through it entirely til I had a physical copy :D
- munificent 5y agoI'll get a bigger cut from Amazon, but order from wherever you prefer.
- macintux 5y agoOrdered, thanks. Regrettably I have read fewer than 1% of the books I’ve ever bought, but this one has a much better chance than most. Congratulations on finally putting this project to rest.
- a9h74j 5y agoSame here to some degree, but my thought in years past was that I could read a purchased [print] book years later, and still express my appreciation (and compensate the author) with a purchase immediately.
- poidos 5y agoI am in absolute awe at the PDF diff tool. Wonderful, wonderful stuff.
- munificent 5y agoIt's literally the best idea I've had since I proposed to my wife.
- humanlion87 5y agoCongrats! Will be getting a copy just because I enjoyed reading the online version. I love your writing style!
- ceronman 5y agoHi Bob! Congratulations on shipping the book! This book has been a life saver during the pandemic, not only the world situation but I personally was a bit disappointed with my career. I was inspired by one of your posts where you mention that you were writing every single day for four years. I decided to use the same approach and I started reading the book and coding a bit every single day. I was able to finish it completely and I wrote two implementations of Lox. I just ordered a paper copy, from the PDF sample it seems it looks gorgeous! Thank you very much for such a great contribution to the world!
- munificent 5y ago> I was inspired by one of your posts where you mention that you were writing every single day for four years. Yes! It is the dumbest, weirdest life hack, but it seems to work for perfectionists like us.
- hartator 5y agoI wonder if anyone wrote a book about this!
- cjcampbell 5y agoAs others have said, congratulations. I've been following your progress for a good part of this journey, and I'm excited that you're finally able to hold a finished product in your hands! And now I'm stuck with a dilemma. I don't _need_ a physical copy, but I really do _want_ one.
- tylerscott 5y agoJust a friendly nudge toward the physical copy. Just imagine that fresh book smell! Full disclosure--I bought the physical copy. I am excited for these illustrations and the layout looks fantastic.
- cjcampbell 5y agoOh, I’m absolutely buying it. Even more so after seeing Bob say that he’d be willing to send a digital copy with a physical purchase. I’ll just have to keep the physical copy at my office so that my partner doesn’t have to suffer more clutter in our small living space.
- syntaxfree 5y agoIt’s good work, congratulations.
- matheusmoreira 5y agoCongratulations. Really enjoy your blog as well, I think I've read every post about programming languages. I've cited them a lot too.
- titzer 5y agoI really like the hand-drawn diagrams in the sample PDF! Are the actually hand-drawn or stylized SVG?
- munificent 5y agoLiterally hand drawn with my hands. Here's a video of me making one: https://www.youtube.com/watch?v=iN1MsCXkPSA https://www.youtube.com/watch?v=iN1MsCXkPSA It's, like, comically time consuming. But also pretty satisfying.
- titzer 5y agoWow, that is indeed some serious dedication. You even fixed the kerning of the labels. The result looks great. Nice job!
- lfowles 5y agoHave you ever tried engineering paper? :) Might save you the step of taping grid paper! The grid only exists on one side, but essentially disappears when scanned. https://www.staples.com/TOPS-Engineering-Computation-Pad-Gum-Top-8-1-2-x-11-Quad-Rule-5-x-5-Greentint-Paper-100-SH-PD/product_811198 https://www.staples.com/TOPS-Engineering-Computation-Pad-Gum...
- munificent 5y agoAh, that's a good idea! I haven't seen that stuff in ages.
- lfowles 5y agoIt tends to be hard to find outside of college towns....
- mwigdahl 5y agoYour book was great; I learned a ton going through it. Congratulations on getting it to print!
- manaskarekar 5y agoThank you so much for everything you have put out. The execution is always beautiful, the content is solid, licensing/pricing model is great, and the meta info about the layout/setup/journey is equally enjoyable. As the saying goes, your books spark joy. Thank you. OT: Do I need to purchase the pdf separately if I purchase the print book?
- munificent 5y agoI try, thank you!
- manaskarekar 5y agoI snuck in the OT question in there as an edit, but curious, is there an option to buy pdf + print or do those need to go separately?
- idsout 5y agoAlso interested in this. I prefer a first pass with a physical copy and having a pdf to use as a reference/search
- munificent 5y agoI don't have any automated way of bundling stuff. But if you email me with some proof of purchase (I don't know, a picture of you holding the book, or an order screenshot or something), I'm happy to email you the PDF.
- manaskarekar 5y agoNice! I can do that. Once again, thank you so much. Can't wait to hear what you announce next.
- skybrian 5y agoIt would be cool to see the Dart script that you wrote to build the book’s website. I know it’s not intended for anything else, but maybe there are some good ideas in there for other websites? Edit: I guess that’s here: https://github.com/munificent/craftinginterpreters/blob/master/tool/bin/build.dart https://github.com/munificent/craftinginterpreters/blob/mast...
- munificent 5y agoThat's correct. The entire build system is: https://github.com/munificent/craftinginterpreters/tree/master/tool https://github.com/munificent/craftinginterpreters/tree/mast...
- intrepidhero 5y agoThanks for writing about your process! I enjoyed it almost as much as Crafting Interpreters, which is to say, quite a lot. And you absolutely should be proud of your PDF->PNG->Highlight diffs script. As someone who has kept excel files and PDFs in version control I knew exactly the feeling you were talking about. I got to that part and exclaimed out loud, "Damn cool!"
- cxr 5y ago> As someone who has kept excel files and PDFs in version control Hot tip for handling office file formats or anything that uses a ZIP container: just unzip them and commit that to the repo. It won't fix the issue mentioned of the authoring tool making seemingly arbitrary and unnecessary changes, nor will it give you nifty visual diffs, but it's better than shuffling binary blobs through your version control tools.
- ric2b 5y agoAFAIK that won't save space in git, in fact it will probably use more due to the lack of compression and the fact that git commits aren't diffs, they're just commonly displayed as if they are.
- cxr 5y ago> AFAIK that won't save space in git Actually, it should (precisely _because_ of Git's approach to storing blobs) but that's besides the point. Saving space had nothing to do with the motivation for the earlier comment. > in fact it will probably use more No.
- cxr 5y ago> I decided to rewrite the whole build system for the book in Dart. The build script I wrote for my first book was dead simple. Literally a single Python script that took a Markdown file for each book chapter and rendered it to HTML while weaving in the code snippets. The world’s dumbest static site generator. [...] Useful, but really straining the limits of how much code I want to maintain in a dynamically typed language like Python [...] it was, frankly, really slow This is great to hear. When I read about your build system in Crafting "Crafting Interpreters" <https://journal.stuffwithstuff.com/2020/04/05/crafting-crafting-interpreters/#a-bespoke-build-system https://journal.stuffwithstuff.com/2020/04/05/crafting-craft...>, I had hopes that your next bugbite would be fleshing out half of a quasi-literate programming tool. For a compiler writer, who also happens to be writing a book, the circumstances and fit seem just too natural to avoid it. I'm looking forward to diving into your Markdown package, too, and expect that it will be easy to port to JS. Nowadays, whenever I need a library for a JS project, my first choice is to check for a clean Dart, Haxe, or Java implementation that does what I want, with the intent of porting it, rather than disadvantaging myself by relying on whatever the NodeJS community has cobbled together and put on NPM. <https://news.ycombinator.com/item?id=24495646 https://news.ycombinator.com/item?id=24495646> EDIT: There is a typo "CCS" in the blog post. Highlighted: <https://hyp.is/d2cCEPCLEeu7jSft-ex2Ug/journal.stuffwithstuff.com/2021/07/29/640-pages-in-15-months/ https://hyp.is/d2cCEPCLEeu7jSft-ex2Ug/journal.stuffwithstuff...>
- nirvdrum 5y agoI've been waiting for the print version before diving in, so I'm excited to see it's now available. For what it's worth, I'd be willing to spend more money on an all-format package. I need to hold a book in my hand and not stare at an illuminated screen to absorb the material, but sometimes carry a big book around is not practical so having a Kindle copy is handy. A PDF copy is good for referencing stuff I've already read. Since the book is printed on-demand, such a package might not really be practical, but I thought I'd mention it. Congrats on getting over the finish line, by the way. It's a huge accomplishment.
- munificent 5y agoThere used to be a thing where Amazon would let you bundle the print and Kindle versions, but I think they stopped doing that. If you buy a print copy and email me some kind of confirmation, I'd be happy to send you the PDF or EPUB file.
- krylon 5y agoThank you so much for all the work you put into this!
- tylerscott 5y agoJust another congrats! I have been waiting for this day. Thanks for all your work!
- jkcxn 5y agoIncredible piece of work, and an inspirational process. Your book helped me write my own language compiler. I love the way you explain the pratt parsing technique and also the way the lexer and parser work together so you don't have to read the whole file at once, and how advance(), consume() and expect() functions work. It all just works together beautifully
- lawn 5y agoI really loved Game Programming Patterns and I'll definitely need to check this out too. The way you made your book(s), from making them available online for free to the excellent layout of the printed version, was a huge inspiration for me to write my own book. Thank you.
- kizer 5y agoGreat job, man. I've consulted the online version a number of times over the years. Will be purchasing this in dead tree form :D.
- munificent 5y ago> Will be purchasing this in dead tree form :D. I like to think of it as "carbon capture representation" these days.
- gurleen_s 5y agoCongratulations on releasing the book! Grateful for your work both as a student of computer science and as a Flutter/Dart developer. I’m planning on buying a copy after work. Are there any resources you recommend as a follow up to this book, and do you have any new content planned?
- munificent 5y agoThe last chapter suggests a few places to go next after reading the book: http://craftinginterpreters.com/optimization.html#where-to-next http://craftinginterpreters.com/optimization.html#where-to-n... I have absolutely nothing planned after this. I plan to not have any plans for a while. :)
- zerr 5y agoCan you please point out the differences compared to other books for the same topic? Thanks!
- EamonnMR 5y agoNot the author, but working through it and having read compiler books in the past... I is very practical vs theoretical, very hands on, and willing to engage with sticky problems rather than glossing over them. The language it implements feels modern (vs the Pascal you do in Let's Write a Compiler.) The writing is fun but not over the top. You hand write the parser instead of using a parser generator.
- geekraver 5y agoIt’s written by Bob and the others aren’t. That’s a good enough reason for me.
- timClicks 5y agoCongratulations, this is such a tremendous achievement. Well done. And thank you for everything that you've done to make language hacking accessible (and Wren is superb, by the way).
- ruuda 5y agoThis was such an amazing read. Getting nervous about not being able to diff things is so relatable!
- jessewmc 5y agoCongrats! Ordered. Been waiting for a physical copy, being able to scribble notes in the margins and bookmark and flip back and forth by hand just works so much better for me.
- kelnos 5y agoThank you so much for all your work on this! I ran through the first part (interpreter in Java, which I ended up doing in Scala for fun) a few years ago, and so much about this sort of thing was demystified for me. I used to think building parsers, tokenizers, AST builders, and interpreters was some sort of unapproachable black magic, but now I realize it's not actually that difficult. I started working on the second part (decided I'd do this one in Rust instead of C), but got distracted by other things and never got around to picking it up again. I look forward to getting back to it! Thanks again, and congratulations on getting to this publishing stage!
- divs1210 5y agoYou might find this blog post interesting: https://ceronman.com/2021/07/22/my-experience-crafting-an-interpreter-with-rust/ https://ceronman.com/2021/07/22/my-experience-crafting-an-in...
- kelnos 5y agoOh, excellent, thanks for the link! I still want to do this myself, but am now pretty wary of building a GC in Rust...
- lemonade5117 5y agohey! I’d been thinking about this just a few days ago! It’s great that the print version is finally out. Congratulations on publishing your book!
- rvbissell 5y agoJust a note to say that your writing is excellent! After seeing this HN post yesterday, I bought your /Crafting Interpreters/ book to see if it could help me evolve my AST-walker into a threaded-interpreter (using GNU's computed goto-label extension.) I find your writing style to be just the right mix of humor and content to keep me engaged.
- qorrect 5y ago#1 Bestseller! -> https://imgur.com/3GJkMvd https://imgur.com/3GJkMvd
- kurinikku 5y agoI love Crafting Interpreters, excited to see it in print! I might just buy a copy to support the author, the illustrations do make it coffee table-worthy.
- qorrect 5y agoI'm putting it on my Christmas list as I'm broke right now, definitely a great display book!
- chubot 5y agoCongratulations, this looks amazing! I enjoyed reading the web version over the last few years and learned a lot from it. Now I'm looking forward to owning the hard copy as well :)
- knuthsat 5y agoI just finished the first part of the book (building the intepreter, but I did it in typed Python). The book sent me back to the college days where I remember doing similar things. Can't wait to start working on the bytecode virtual machine. It's really an excellent book.
- xcubic 5y agoHow difficult was it to make this in a different language than the one used on the book?
- munificent 5y agoReaders have ported the code in the book to many languages already: https://github.com/munificent/craftinginterpreters/wiki/Lox-Implementations https://github.com/munificent/craftinginterpreters/wiki/Lox-... That means it's either not too hard to do yourself, or at the very least you can use their ports as a reference as you work through the book.
- jstx1 5y agoOf course Rust has the longest list in something like this. Thanks for the book by the way, I'm picking it up for the first time now
- slmjkdbtl 5y agoPretty easy, it uses Java and C and didn't use any "exclusive features" of them
- xcubic 5y agoHow about external libs?
- munificent 5y agoThe code in the book deliberately uses no external dependencies. You'll be fine. :)
- jjice 5y agoI got excited when I saw the email, and I'm glad this is at the top of HN now. Fantastic modern book on language development that I'd recommend to anyone interested in the subject.
- nightowl_games 5y agoBob Nystrom's writing is easily the most enjoyable technical writing I've come across. He has the same precision and humour that Scott Meyers brings to C++, but then with even more humor and far more interesting subject matter. I found his blog on my phone in the middle of the night one night, and enjoyably read hours of it instead of sleeping. Keep writing, Bob!
- dilap 5y agoI read the free web version of this; it's probably my favorite tech book ever. If you want to learn the basics of implementing a programming language, I can't recommend this enough.
- vmchale 5y agoBetween A) Being implemented in Java and B) Not having anything satisfying on types I can't get excited about it. I know it's an uncommon opinion but there's so much missing it can't be a monograph/treatise.
- tlhunter 5y agoThe PDF sample I opened suggests it's implemented in C. The GitHub suggests it uses both C and Java: https://github.com/confucianzuoyuan/craftinginterpreters https://github.com/confucianzuoyuan/craftinginterpreters
- munificent 5y agoThe book walks through two interpreter implementations. The first is in Java, and the second in C. The code has also been ported to many other languages: https://github.com/munificent/craftinginterpreters/wiki/Lox-Implementations https://github.com/munificent/craftinginterpreters/wiki/Lox-...
- chrisseaton 5y agoWhat’s wrong with Java for a compiler implementation language? One of the most powerful dynamic compilers in the world is in Java. And its object orientated design works well for compilers.
- recursivedoubts 5y agoI used the website for my compilers class this last semester and it was great. Recursive descent parsing and a hand-rolled lexer teaches grammars and general language design way better than other alternatives.
- ufo 5y agoSometimes I with that intro to compilers books placed a bigger emphasis on recursive descent. Recursive descent works anywhere, without dependencies to external tools such as Bison or ANTLR. I hope that this book marks the start of a trend. Sure, everyone should learn about LR parsers at some point. But I'd argue that outside a compiler class, knowing recursive descent is likely to be useful more often than knowing LR parsing.
- matt_craig 5y agoAs soon as I got the release email I came here to check if this had been posted to HN; it’s an incredible piece of work, and I highly recommend it. It sweeps away much of the mystery behind programming language internals in a clear, easy-to-follow, humorous way. I worked through the first half of the online book recently, and am excited to buy the print version and work through the rest of it. I can’t get over dead trees, and as fun as it was using the free online version (thanks munificent!), the paperback version will be even better.
- ve_era 5y agoCongratulations! I was just wondering when I'll get to have a physical copy while I was working through chapter 8 in Crafting Interpreters. Thank you so much for your contribution.
- tyingq 5y agoSomewhat related, I recently read about the undocumented tokenizer that comes with the python re module. https://www.reddit.com/r/ProgrammerTIL/comments/4tpt03/python_til_about_rescanner_which_is_useful_for/ https://www.reddit.com/r/ProgrammerTIL/comments/4tpt03/pytho...
- yatac42 5y agoWord of warning: The Scanner class does not adhere to the maximal munch rule, so you shouldn't use it to match keywords the way that it's done in the code in the linked reddit thread. If you replace the word "foobar" in the input with "truebar", it will then be tokenized as the keyword true followed by the identifier "bar", which is obviously not what you want.
- criddell 5y agoIs the Kindle version of your book protected with DRM?
- munificent 5y agoNo, there is no DRM on any of the electronic formats—Kindle, EPUB, or PDF. If you buy it, it's yours. (But please don't upload it to any ebook-sharing sites.)
- criddell 5y agoNot planning on uploading it, but if some formats had DRM and others did not, I would pick one DRM-free formats. Also, I read the first few pages on Amazon and I'm sorry about Ginny. She looks like she was a good friend.
- munificent 5y agoShe was my #1 buddy.
- EamonnMR 5y agoAwesome! I just started working through this too.
- 6d65 5y agoBought the PDF after reading the free web version, the work definitely has a lot of love put into it and this has to be rewarded. I've skimmed the web version till the end, but thoroughly read half of it, still learned a lot. Especially the pragmatic approach to code generation via string concatenation. I went a bit further with a small dsl that also does string concatenation. My C# and Rust implementations are half baked, but still I had a lot of fun doing them, and that's all that counts. Can't wait to see Bob's next endeavor.
- brundolf 5y agoI'm not normally a book person when it comes to learning things, but Crafting Interpreters was fun and easy to follow along with (getting to code something as I went really helped hold my attention) I went through Part 1 towards the beginning of quarantine, and it spawned several really fun projects and I now feel like I have a basic level of skill writing parsers, which I've actually gotten to use a couple times at my day job. I will say, I feel like it would be a lot harder to follow along with a physical print vs another window on my computer screen. But I may buy one anyway just to support the author. Highly recommend!
- gre 5y agoCongrats on finishing your book. I ordered a print copy!
- marai2 5y agoWhy Bob why! I kid you not, just 2 days ago I typed your name in the Amazon search box to see if this book would show up even if for pre-orders, but it didn't show. I had some $work money to spend on educational resources and I wanted to buy this book! I ended up buying other books. But seriously congratulations! I'll happily spend my own money to support all the effort you put into this!
- kendru 5y agoI am so excited to see this in print! I know that this was a ton of work, and I can't wait to get a paper copy. Nice work, Bob!
- Impossible 5y agoThis book was in development while I was working on the core interpreter for the Facebook Horizon visual scripting language. While many things in it are not directly applicable to a VPL, it helped with more robust implementation in at least one area (branching) and overall was a joy to read. I prefer to read print so I'll pick this up
- tychota 5y agoI did follow the whole adventure online. I will buy this bokk for sure. Thanks, Bob. You did a wonderful job.
- deleted 5y ago[deleted]
- hadjian 5y agoI mostly read PDFs on an iPad. The only books I bought as paperbacks are the ones I will reread over and over out of joy: Knuth: The Art of Computer Programming CLRS: Introduction to Algorithms Strang: Introduction to Linear Algebra H&P: Computer Architecture: A Quantitative Approach and now I ordered yours, Bob! Just wanted to show my respect. When my crunch time is over at work I will answer the issue I opened on GitHub ;-)
- hadjian 5y agoI received my copy yesterday! Any plans for a hardcover instead of a paperback? Just lies nicer on a table and doesn't wear of as fast.