proj-plbook-plChClrLang

Table of Contents for Programming Languages: a survey

CLR

This chapter is about the CIL's intermediate language. For information about other aspects of the CIL and the CLR, see CLR.

Introduction: https://en.wikipedia.org/wiki/Common_Intermediate_Language

There is also a DLR for dynamic languages (built on top of CLR)

alternate, open implementation: Mono

Rasmus Ejlers Møgelberg Common Language Infrastructure • Much the same philosophy as JVM, but - Many source languages: C#, VB.NET, F#, SML, JScript, Eiffel, Ruby - Tail calls support functional languages - True generics in byte-code: safer and faster - User-defined structs " -- Rasmus Ejlers Møgelberg, http://itu.dk/people/mogel/SPLC2012/lectures/SPLC.2012.12.pdf

"MSIL (for Microsoft Intermediate Language) is a unique case of object-oriented assembly language in human-readable form. It is closer to assembly than GIMPLE, with local variables being translated into stack offsets, while still maintaining types. It is also known as CIL for Common Intermediate Language. It is indeed the first common intermediate language to which all languages in the Common Language Infrastructure or the .Net Framework translate, in the Visual Studio compiler suite. " -- Yannick Moy. Automatic Modular Static Safety Checking for C Programs. PhD thesis, Université Paris-Sud, January 2009, section 2.1, page 42

Types

15 primitive types: bool, byte, sbyte, char, decimal, double, float, int, uint, long, ulong, object, short, ushort, string

-- http://msdn.microsoft.com/en-us/library/ya5y69ds.aspx

Instructions

The CIL has 67 base instructions and 33 object model instructions, according to " Common Language Infrastructure (CLI) Partition III CIL Instruction Set".

"

Instruction encoding

Instructions are one or more byte opcodes (currently, one or two bytes) followed by zero or more operands. They can also have prefixes.

Links