Icc.NET: targeting the .NET common intermediate language from standard C

  • Authors:
  • David R. Hanson

  • Affiliations:
  • Microsoft Research, 1 Microsoft Way, Redmond, WA

  • Venue:
  • Software—Practice & Experience
  • Year:
  • 2004

Quantified Score

Hi-index 0.02

Visualization

Abstract

The Core of the Microsoft .NET platform includes a new virtual machine (VM), the Common Intermediate Language, also known as MSIL. Unlike most other VMs, including the Java VM, MSIL is specifically designed to support a wide range of languages. While it is designed primarily for type-safe object-oriented languages, it also has facilities that support both low-level languages and very high-level languages. For example, it accommodates unsafe pointer arithmetic and tail calls. This paper describes the implementation of a MSIL back end for lcc, a retargetable compiler for Standard C. C is at one end of the range of languages that MSIL intends to support and lcc is just about the simplest 'real' C compiler that is widely available. Porting lcc to MSIL thus provides a realistic test of how well MSIL supports this class of languages and provides a glimpse at its performance costs. This effort succeeded but static initializations, function pointers, separate compilation and address arithmetic were major problem areas These problems also suggested improvements to lcc's code-generation interface and they exposed a long-standing error in the lcc front end. Preliminary measurements suggest that programs compiled by the MSIL back end run two to three times slower than those compiled by lcc native Intel x86 back end, but the MSIL programs have some important diagnostic benefits.