Build a simple interpreter!


Details
Interpreters for programming languages are really, really interesting to implement. For this code retreat, I thought it would be fun to implement the following challenge: The task is to write an interpreter for a little functional language - lambda calculus with n-argument functions and integer arithmetic. There are several means to represent variables and environments in such an interpreter. For instance, variables could be strings and environments association lists, or variables could be DeBruijn numbers, and environments simple stacks. The question is this -- how much of your interpreter can you re-use if you change your decision how to represent variables and environments? This challenge is taken from a description by Martin Odersky, the father of the Scala programming language, of a challenge that was put to him and other functional programming enthusiasts. Here's the original post, which can serve as food for thought: https://scala-programm... (https://scala-programming-language.1934581.n4.nabble.com/scala-usefulness-of-OOP-tp2000320p2000335.html)

Build a simple interpreter!