HACKER Q&A
📣 overclk64

Books like “Crafting interpreters” or “The ray tracer challenge”?


I absolutely loved these two. I'd be very grateful if someone recommended similar books, that is, books that guide you through implementing a complex project from scratch (something besides compilers/interpreters and ray tracers).

Thanks.


  👤 bmitc Accepted Answer ✓
These types of books are my favorite style. I typically use whatever language I'm trying to learn and get more practice with (usually F#, Elixir, or Racket) instead of whatever the book suggests, if it does suggest one (usually Python or some OOP language). But sometimes the language used in the book is fun, like Logo or Prolog.

* Mazes for Programmers (by the same author of The Ray Tracer Challenge but is not as language agnostic)

* The Elements of Computing Systems: Building a Modern Computer from First Principles

* Programming Machine Learning: From Coding to Deep Learning

* Writing an Interpreter in Go and Writing a Compiler in Go (both by the same author)

* Introducing Blockchain with Lisp: Implement and Extend Blockchains with the Racket Language

* Exploring Language with Logo

* Visual Modeling with Logo

* Turtle Geometry: The Computer as a Medium for Exploring

* Thinking as Computation: A First Course (uses Prolog to solve various problems in small projects)

* Functional Web Development with Elixir, OTP, and Phoenix: Rethink the Modern Web App


👤 agarren
Build a Blockchain from scratch in Go [0] - don’t own it, haven’t read, looks interesting.

Distributed Services with Go [1] - build a logging service, get it on the network, modify for distributed access, make deployable. Loaded with tests. Have read most of it, haven’t completed, very impressed. Fun.

Build an Orchestrator in Go [2] - own it, started it, haven’t completed. Like it so far. Early access, so not finalized yet.

Would also second both Crafting Interpreters and Write an Interpreter in Go.

[0] https://web3coach.gumroad.com/l/build-a-blockchain-from-scra...

[1] https://pragprog.com/titles/tjgo/distributed-services-with-g...

[2] https://www.manning.com/books/build-an-orchestrator-in-go


👤 busterarm

👤 sarupbanskota

👤 smueller1234
Not particularly hip anymore, but "Higher Order Perl" was great fun and has a bit of that style both in the incremental construction and also a little bit in the writing style. But it's been over a decade since I last picked it up.

👤 rg111
1. Nature of Code- simulating and modeling many things in nature.

2. Data Science from Scratch- building a Data Science library from scratch.

3. Deep Learning from Scratch- building a Deep Learning library from scratch.

4. Realm of Racket and 5. Land of Lisp- developing games with Racket and Lisp.

6. The Little Schemer- not only teaches you to think recursively, but also how to implement basic functions like addition, multiplication, list-related function from using Scheme for Scheme.

7. Genetic Algorithms in Elixir

8. Genetic Algorithms and Machine Learning for Programmers


👤 cben
"Understanding Computation: From Simple Machines to Impossible Programs". I knew many of topics and enjoyed it nonetheless. Highlights:

+ Very insightful chapter on different flavours of language semantics, and specs vs implementation.

+ The standard CS automata/ grammars stuff, but with working code.

+ Fun chapter on FizzBuzz in lambda calculus (it's also the free sample+video). Whats vool there is not just showing you _can_ compute everything (of vourse you can) but that you can build high-level constructs so the resulting code is todally clear.

+ A bit of the standard CS computability stuff, but then gets into esoterically minimalistic yet turning-complete stuff like 1D cellular automata.

+ Type checking as a form of partial evaluation, and some other "symbolic" stuff you can do with partially-evaluting interpreter. Some overlap with dependent types - but a more pragmatic less type-theoretic angle.

Author uses a carefully selected subset of ruby, introduced in a short intro - big props for being thoughtful about that.

P.S. +1 to Mazes book too (which is not as conscious about its ruby use, fun anyway)


👤 jamessb
500 Lines or less [1,2] might be of interest: it doesn't build up a single complex project from scratch, but it several show the core implementation of various complex types of software.

[1]: https://aosabook.org/en/

[2]: https://github.com/aosabook/500lines


👤 mhh__
The struct and interpretation of classical mechanics is a good one.

The only thing I'd say is that complexity in this styles of projects is not in the code. Unless you start a new compiler from scratch I'd say something like 70% of my time not thinking about language semantics are spent thinking about target semantics, not anything you'd see in a book. Any I almost literally do mean anything.

One slightly left field approach is that although Leslie Lamport has a very math-first writing style he actually typically does build up to the analysis of more and more practical systems when he writes about TLA+.

Knuth sort of does this with the caveat that you have to be very good at reading through the lines if you want a tutorial-esque experience.


👤 shreyshnaccount
Is there any book for web dev (maybe Django?) that uses this method? Should we write one?

👤 abhijat
Hands On Rust: walks you through building a dungeon crawler game.

👤 FiberBundle
Appel [1] is fairly good for learning compilers. He leaves a lot of the material to the exercises, which are somewhat frustrating,but if you fight through them you'll definitely be rewarded.

[1] https://www.cs.princeton.edu/~appel/modern/


👤 abhijat
There's also a book called "building git" on writing git from scratch in Ruby.

👤 rohitpaulk
You'll love codecrafters.io

👤 chillpenguin
Fractals, Visualization and J By Clifford Reiter

👤 ThePhysicist
"Physically based rendering: From theory to implementation" by Humphreys and Pharr.