3 ms·
One way to get your feet wet is to write an eval function for a small language like "basic arithmetic language" in your programming language of choice. Allow on
by dntbnmpls 7y ago
One way to get your feet wet is to write an eval function for a small language like "basic arithmetic language" in your programming language of choice. Allow only an int type, a few operators ( add, sub, mul ), etc. Then have eval parse then run a statement(s) from "basic arithmetic" and you'll get an idea of how interpreters work. From there you can delve into theory and writing interpreters for more complex languages. I believe in doing first and then learning theory after. Also, you can try writing eval in an OO language, functional language and procedural language to get a deeper grasp of the differences between these programming paradigms.
- codr7 7y agoIndeed, that's pretty much where I started out; Arithmetic evaluators and template engines. But it's a giant leap from there to Pascal, which is why I like to recommend Forth as a stepping stone.