viernes, 22 de marzo de 2019

Technical Overview of the CLR


In this article we read about the common intermediate Language, it seems to be better than the Java Virtual Machine. In this article we can see the pros of using common intermediate Language and also the cons of using the java virtual machine. Many experts have written about the disadvantages of using the JVM, and here we can see them clearly.

There are reasons to choose an alternative to native compiler, which are:
  • ·        Portability
  • ·        Compactness
  • ·        Efficiency
  • ·        Security
  • ·        Interoperability
  • ·        Flexibility

The Java Virtual Machine does not give a way to encoding type-unsafe features of typical programming languages, such as pointers, immediate descriptors and unsafe type conversions.
It also has a lot of libraries not only for have but for other languages, this makes it a multi-language platform.

There is a tool called CLI developed by Microsoft that has good support for imperative and statically Oriented Object Languages. The code created with a language compiler that targets the runtime is called managed code. It benefits from some features like the cross-language integration, cross-language exception handling, enhanced security, versioning and deployment support, a simplified model for component interaction, debugging and profiling services.

The common language runtime called CLR, makes it easy to design components and applications whose objects interact across languages. Also in this article we read that objects written in different languages can communicate with each other, and their behaviors can be tightly integrated. CLI is not the perfect multi-language platform but is way better than java virtual machine

lunes, 11 de marzo de 2019

Ruby and the interpreter pattern report



This entry is to talk about the article “Language Design and Implementation using Ruby and the Interpreter Pattern” written by our professor Ariel Ortiz. Int his article we read about the SIF, which means S-Expression Interpreter Framework and it is used to demonstrate advanced language concepts and also to demonstrate programming styles. It is a tool for teaching language design and implementation. It is an interpreter based on the Interpreter design pattern.

It is so simple to use, it allows integers, symbols, lists and procedures. Also, we have to mention that Ruby has power and flexibility of dynamic languages, so it is easier to understand. This pattern allows us to write interpreters that can be studied with basic build blocks that this pattern provide us. We can see the different behaviors of trees after being interpreted, and this is called a functional program.

Using an interpreter, the syntax is implemented in the initialize method, it receives an array with all the arguments. Then, validates the syntax and constructs the substrees that corresponds. Also with this method we can analyze the semantic analysis. Here, this method receives a context as a parameter and is called recursively for some or all the child nodes.
One difference that can be noticed is that a compiler generates intermediate code, while an interpreter is a reduced version of a compiler. The Design of patterns is very important to be considered in the process of designing a compiler.