Abstract:
Since the publication of the standard that describes the multi-language framework known as Common Language Infrastructure (CLI), it has been a challenge letting non class-based programming languages being run on the CLI. ECMAScript, being a prototype-based, object-oriented, functional programming language, belongs to this category. Running ECMAScript programs in the CLI will offer a scripting language with the efficiency of a strong typed language but keeping its dynamic nature. Features like first class functions, late binding, and dynamic objects are not included in CLI by default, so the purpose of this compiler is to show that those features can be implemented using the CLI. Among the characteristics that we measured are the ability to store functions in data structures, passing them as parameters and returning them as values, and the possibility of adding new properties to already defined objects. It's possible to implement first class functions as well as dynamic objects with a cost in the size of the code generated, but also increases the flexibility of the programs that make use of them, allowing the use of software patterns which are rarely used in conventional programming languages.