4
lxmcf
6y

Started work on a language interpreter and all is going well, until I realise I still need to implement a way of reading and executing code blocks and work out if statements... Ah fuck...

Comments
  • 4
    Dont forget about the lööps :P
  • 1
    @Gregozor2121 Loops are piss easy, if you can work out how to build an if statement and functioning blocks, its the same principle as tying functions to block execution... Buuuuuuut I still can't work out either so loops are scaring me now
  • 4
    I can really recommend http://craftinginterpreters.com, before that interpreters and compilers were dark magic to me, now they are a bit less dark magic, but still magic :D
  • 0
  • 1
    @JoshBent well the site works with https as well, just no automatic redirection.
  • 0
    What kind of interpreter are you making? (treewalk, bytecode, ...)
  • 0
    @YADU for now not going to touch bytecode untill I can grasp an AST easily enough
  • 0
    @lxmcf fair enough, just wondering so we can give advice on how to implement stuff, since it's different depending on what kind of interpreter you're making.
  • 0
    @YADU Yeah I've noticed that, I'm going to build the same one in multiple simple languages just to get the basics then implement bytecode into each, just drill it into my head essentially
  • 0
    @lxmcf I'm not sure what you mean by your last comment
  • 0
    @YADU I meant Ive noticed how different it can be, Ill stick with just AST until I can build them with my eyes closed then I'll move onto bytecode
Add Comment