Bartok (compiler)

Bartok is an optimizing compiler and managed runtime system for Common Intermediate Language (which .NET languages compile to), being developed by Microsoft Research.

Overview
Bartok aims to be efficient enough to be usable for writing operating systems. It provides services such as automatic memory management and garbage collection, threading, and marshalling data to and from native code, as well as verification of CIL code. Bartok is written in C#, including the garbage collector. Bartok is being used by Microsoft Research for the implementation of Singularity, a highly-dependable operating system written almost entirely in managed code.

Bartok allows various implementations of the garbage collector, base class library and other components to be chosen at runtime on a per-application basis. This feature is being used to write the different components of Singularity – kernel, device drivers, and applications – each using a separate class library that exposes functionality required by (and optimized for) the specific usage.