10 pointsby ezzato8 hours ago2 comments
  • markus_zhang3 hours ago
    Crafting interpreters. Very well written and free of cost, but ofc I’d recommend purchasing a copy.

    If you find it a bit hard to chew, there is a simpler book using Python: https://www.amazon.ca/Anthony-J-Dos-Reis/e/B001KE4SU8/ref=dp...

    Another book: Game Scripting Mastery.

    • stevekemp40 minutes ago
      Crafting Interpreters is a good recommendation, and in the same spirit "Writing an Interpreter in Go" (and it's followup about writing a virtual machine) is a good addition.

      A lot of the complexity and front-work of these kinda things is the parsing step though, so you can follow MAL (or any other make a lisp tutorial) though that won't necessarily help with other languages it frees you to jump to the interesting parts.

      FORTH, mentioned in another comment, has that same appeal. I wrote a quick tutorial here, back in the day:

      https://github.com/skx/foth

  • tnelsond47 hours ago
    I tried reading the dragon book in my teens, never really understood it, it was too much theory for me.

    I'd recommend starting with implementing a forth since it's the easiest language to write an interpreter/compiler for. From there you'll have enough experience to go for something bigger.

    Making your own bytecode is really fun.

    Ultimately you'll probably want your compiler to target llvm bytecode so that it works on every target automatically.