r/functionalprogramming • • Jul 10 '23

Question Interpreter

I’m interested in writing a small interpreter and I keep hearing that it is best/ easiest to do it in a functional language, why is that?

3 Upvotes

4 comments sorted by

View all comments

Show parent comment

3

u/HaskellLisp_green Jul 10 '23

It's very interesting idea about implementation of interpreter in OOP language, but there is ability to use simpler solution. Every element of ast is associated to lambda function, so we can use hash-tables and then "interpret" function iterates over AST, calling required function.