Ruby and the Interpreter Pattern
This reading is about an article titled “Ruby and the Interpreter Pattern” and I am going to talk about what I read in the article and my opinion about it, as we have learned many things into this course, there have been several terms used in the classroom, Interpreter, translator, these are words used in the context of compiler design but this reading is about Ruby and it is weird because ruby makes me think in another class, however there is a good reason why ruby is mentioned in this reading, and well it is because as we learned in our software architecture course there is something called the interpreter pattern and with this pattern we can have an interesting implementation (which is exemplified by our teacher the author of this article, Ariel Ortiz).
By implementing the interpreter pattern our teacher tells us that we can build S-Expressions that are similar to functional programming languages like LISP, Clojure and F# using a framework called S-Expression Interpreter Framework (SIF), which is a domain-specific language that includes Ruby programming language.
This framework does several things, first it reads a string that represents a source program scanning the input, for this we use the Ruby regular expression API. Then, a hand-written recursive parser does the syntactic analysis this will turn the S-expressions into Ruby data values which will be used to create an abstract syntax tree.
As we can see from this reading ruby is a very powerful language that can be used for many things and it is always interesting to have readings like this one in which you learn more things about something that we are used to use.
Comentarios
Publicar un comentario