domingo, 19 de marzo de 2017

Comment about "Technical Overview of the Common Language Runtime (or why the JVM is not my favorite execution environment)"

Although JVM is one of the primary tools chosen by language researchers, it might not be good with other languages than Java. The main reasons for choosing an alternative to native compilers are:

Portability
Compactness
Efficiency
Security
Interoperability
Flexibility

JVM is an attractive option because of its high-level runtime support and the rich set of libraries. But in the other side it is important to say that it doesn't gives a way to encoding type-unsafe features of typical programming languages, such as pointers, immediate descriptors  (tagged pointers) and unsafe type conversions.

Other features that it lacks of are:

  • Unboxed structures and unions (records and variant records)
  • Reference parameters
  • Varargs
  • Multiple return values
  • Function pointers
  • Overflow sensitive arithmetic
  • Lexical closures
  • Tail calls
  • Fully dynamic dispatch
  • Generics
  • Structural type equivalence


Another tool that has been developed is the CLI by Microsoft which has good support for imperative and statically Oriented Object languages. One of the great features the CLI has is that it maps natural-size or generic types depneding on the processor, for example, a native int would map to int32 on a Pentium processor, but to int64 on an IA64 processor. All of this is made at JIT- or run-time. This can make the program work better in different processors and it wouldn't be tedious for the person to design its program for each of the great amount of different processors in the market.

In summary the main points that are mentioned in the paper are how the CLI is better in assembling files, it supports a number of primitive types, its instructions are more polymorphic, provides a number of instructions for transferring values to and from the evaluation stack, supports types such as classes, interfaces, arrays, delegates, it has two call instructions for directly invoking methods and interfaces and another important one is that it supports tailcalls which are the only way to do recursion in languages such as Haskell, Scheme, Mercury, etc.)

Sources:

Erik Meijer, J. M. (2001). Technical Overview of the Common Language Runtime. From http://webcem01.cem.itesm.mx:8005/s201613/tc3048/clr.pdf

No hay comentarios:

Publicar un comentario