Lambda the Ultimate

inactiveTopic A Research C# Compiler
started 10/19/2003; 12:04:46 PM - last post 10/24/2003; 9:41:45 PM
Ehud Lamm - A Research C# Compiler  blueArrow
10/19/2003; 12:04:46 PM (reads: 5401, responses: 3)
A Research C# Compiler
Todd A. Proebsting and David R. Hanson. MSR-2003-32

This paper describes a new C# compiler designed specifically to provide that infrastructure. The overall design is deceptively simple. The parser is generated automatically from a possibly ambiguous grammar, accepts C# source, perhaps with new features, and produces an abstract syntax tree, or AST. Subsequent phases (dubbed visitors) traverse the AST, perhaps modifying, annotating it or emitting output, and pass it along to the next visitor. Visitors are specified entirely at compilation time and are loaded dynamically as needed. There is no fixed set of visitors, and visitors are completely unconstrained.

Being able to reason about language behaviour based solely on abstract semantics is like having perfect pitch in music: immensly useful if you are a composer (or language designer) but extremely rare in the poplulation. Practice helps, but not much.

That's why definitional interpreters are so useful: they allow you to experiment with language constructs, and language design ideas. Want to see if your new construct should have dynamic scope? Make the change, and see what happens.

This work follows this standard approach, even if it deals with a compilation system (is that just a fancy way to say compiler?) Obviously, the focus here is on compile time facilites and not run time behvaiour, and indeed the authors confess that most usage to date has been for tools, not for language design experiments. Still, via the magic of source-to-source transformations real language design work can also be done.


Posted to implementation by Ehud Lamm on 10/19/03; 12:06:14 PM

Mark Evans - Re: A Research C# Compiler  blueArrow
10/21/2003; 11:08:57 PM (reads: 470, responses: 0)

Todd is always worth a read. I just wish he could get official permission to release his customized Microsoft Research variant of Icon.

Off topic, let me sneak in a plug for open-source (non-Microsoft) toolchains relating to C#. They do exist. Just search the web for keywords Eclipse, SharpDevelop, MONO, DotGNU, or read this. Personally, I like Eclipse, because it's platform- and language-neutral.

Patrick Logan - Re: A Research C# Compiler  blueArrow
10/22/2003; 10:15:49 AM (reads: 454, responses: 0)
Pardon my ignorance (I'm not being sarcastic).

What is the research value of mini-icon, the objective of which is to explore new data types in icon?

Is the objective to understand the new data types, using icon as the petri dish? Or is the object to understand the integration with icon per se?

Mark Evans - Re: A Research C# Compiler  blueArrow
10/24/2003; 9:41:45 PM (reads: 438, responses: 0)
I dunno, but as a fan of Icon, I wish they'd let us in on the secret. There may have been some connection with early .NET research, .NET being concerned with how to reconcile data types across languages.