Ruby and the Interpreter Pattern

The article Ruby and the interpreter pattern, written by my professor of compilers design and software design, Ariel Ortiz, is a paper that describes the SIF Framework which basically is, using Ruby as a base, he created a framework to be able to make LISP-like functions or more well known as S-Expressions. The Author mentions he uses Ruby to teach about this design pattern because of its functions and way it is made that does not make the students feel like they are cheating on how they are approaching the problem.

In the article que mentions he uses the interpreter pattern which he mentions it is a way of structuring the data like a tree and in which every part of the source code is represented as a specific kind of node.

I can see why we are reading this for our class, since our professor is teaching us how to make the design of a compiler and the example given uses the same design of a tree with nodes for each specific need. And understand why this design pattern since it simplifies the way we read the source code and how we can implement it in our own compiler.

Having S-Expressions on a language like Ruby seems quite useful, specially adding the novelties and extra tools that functional programming can add to a language such as this one, I find this project quite interesting and make me wonder if there is any other implementations to other languages that normally do not support this type of expressions like python or JavaScript or any other language I have learned during my courses and if any those I might start learning on how to use them and start implementing them to my set of tools.

Comments

Popular posts from this blog

Technical Overview of the CLR

Building Server-Side Web Language Processors

The Hitchhiker’s Guide to the Galaxy