Scheme Compiler in Incremental Steps: Procedures 23 December 2023 In this post, let us add procedures to our compiler. Procedures or functions are a basic building of any language – especially so with lisp because it was highly influenced by Alonzo Church’s lambda calculus. Lists and procedures/functions togethe...
Scheme Compiler in Incremental Steps: Heap Allocation 19 December 2023 A lisp is not a lisp if it doesn’t support lists! In this post, let’s implement complicated data structure like lists, strings, etc. These data structures don’t fit in single word like they did for integers, characters and others from our earlier ...
Scheme Compiler in Incremental Steps: Conditional Expressions 18 December 2023 In this post, let’s implement conditional expressions: (if test conseq altern). This is simple to implement at assembly level. We need to employ two labels to transfer control to conseq or altern based on whether test is true. In scheme all values...
Scheme Compiler in Incremental Steps: Local Variables 18 December 2023 In the previous post, we added stack to our implementation of scheme. This allowed us to store intermediate results and therefore binary primitives like (+ a b). Since we now have stack, adding local variables should be straightforward. We will im...
Scheme Compiler in Incremental Steps: Binary Primitives 17 December 2023 In the previous post, we added unary primitives like add1 and null? to our language. In this post, let’s implement binary primitives like +, *, and char<?. We cannot, in general, use a single register because evaluating one argument may overwri...