Ruby and the Interpeter Patttern
SIF is a useful tool for us as students because it lets us know how an interpreter works and how is it designed to translate from that framework to Ruby language and to implement any function we want the interpreter to do. Despite the fact that the interpreter is quite small, it has enough functions to let us know how it identified variables, functions and does evaluation to create the procedures, functions or statements we want. We can create add new functionality by following the rules described by the article to test how does the functional, imperative and object-oriented programming styles work and to test the variable scopes and continuations.
What I believe is that this kind of approaches to language programming lets us appreciate more than we usually do by reading books and coding apps while we learn by the documentation. That is because we can, literally, design the way the programming language works and find new ways to make it more easy to understand, or more compact, or more efficient. By using this framework, I believe we can understand, deeply, the way not only interpreters, but compilers work by identifying the elements that compose the instructions.
To end this post, I’ve got to mention that in my short experience I've used many programming languages as C, Java, Python, Swift, Javascript, but sometimes I cannot understand why the programs I code do weird thinks. I believe this is because of sometimes I need to read more about the specifics and rules of the particular language. This framework is useful now but making it with other languages such as Clojure or Erlang, that I believe are the weirdest I’ve known, would be interesting an interesting challenge for the new generations of programmers. Especially Erlang because of the need of concurrent programming nowadays.
Comentarios
Publicar un comentario