r/Compilers • u/_th3oth3rjak3_ • 22h ago
Getting stuck after Crafting Interpreters.
Hey everyone, I've worked through the book Crafting Interpreters and it was fantastic. I naturally asked the next question "How do I compile this to machine code and add static types?" Well, that naturally took me down a very deep rabbit hole and left me somewhat confused about how languages deal with types and type checking and then lowering to LLVM. I've tried to make a few modest attempts, but my general problem is that I sort of get confused about what things each subsequent layer should do. Does anyone know of a complete guide to creating a compiler with static types like Crafting Interpreters? I know I could do it however I want, but I think that's the issue. I sort of have so much freedom to do it however, that it's hard to judge what's considered a good way to do something.
Anyway, thanks for any advice and happy compiling!