The paper talks about how to use the S-expression interpreter framework (SIF) to teach language design and implementation, which is written on Ruby (described later on), the SIF has a simple core that can be extended (we will talk about this later, specifically about how can be extended to support functional programming or imperative programming). The “S-expressions” means symbolic expressions, and this is a parenthesized prefix notation used in lisp family languages, for example ( + a b), this is interesting because I did not remember this concept from the course where we learned Clojure ands it is good to remind it.
The SIF works as the interpreter pattern (one of patterns of the “Gang of Four”), and as I said it is written in Ruby which is an interpreted, dynamically typed language, which syntax borrows from Eiffel, Ada and Perl, and its object oriented based in spirit of Smalltalk. One of their most important components is the node class and their subclasses (I think this is related to the third phase of our project, where I saw that we will use the node class and implement subclasses from it). I did not understand one hundred percent fine how this class works, but I understand that it checks in part the syntax and semantics, something that we have already checked for our project.
Finally, the paper talks as I said before, how we can extend the functionality of the SIF to be able to use it to interpret functional programming languages, this through defining some special “forms” (quote, define, if and fn) to be capable of “reading” its grammar. And in other hand the author mentions how to extend it to be useful for imperative programming languages, defining the special “forms” (set! and begin) and a new class called “environment”.
No hay comentarios:
Publicar un comentario