Return Zero

Tag: interpreter

LISPy-JSON 7: Support recursion in an interpreter

This post is a continuation of LISPy-JSON Part 1, Part 2, Part-3, Part-4, Part-5 and Part-6, you should read these prior to reading the current post. We already have the capability of defining and calling functions, but we do not have the ability to resolve functions and variables defined in the parent or grand parent scope. We will limit ourselves […]

LISPy-JSON 6: Implement functions in an interpreter

This post is a continuation of LISPy-JSON Part 1, Part 2, Part-3, Part-4 and Part-5 you should read these prior to reading the current post. To implement functions, the first thing we would need is to design a syntax for our function declaration. Functions usually have three things, a function name, a list of arguments and the function body. The […]

LISPy-JSON 5: Implement If-Else in an interpreter

This post is a continuation of LISPy-JSON Part 1, Part 2, Part-3 and Part-4 you should read these prior to reading the current post. If-else is nothing but an extension of functions that implement binary operators. With a binary operator you evaluate the two expressions and operate on the result. With the If-Else statement, you have three expressions: […]

LISPy-JSON 4: Comparison and Boolean operators in an Interpreter

Note: This post is a continuation of LISPy-JSON Part 1, Part 2 and Part-3, you should read these prior to reading the current post. Comparison and Boolean Operators are very simple to implement in our Interpreter’s model, If you remember how we implemented binary operators like +, – and so on, These would follow a […]

LISPy-JSON 3: Variables and State in Interpreters

This post is a continuation of LISPy-JSON Part 1 and Part 2. Most programming language support some way of referring to data in memory, we call them variables. Javascript syntax looks like the following: But instead of the ‘let’ keyword, we will use the ‘def’ (define) keyword, This is just so that it looks a […]

Back to top