//
you're reading...
.NET 1.x

C# compiler written in C#

Mike Stall has released his C# compiler thats written in C# to the world.

For anybody looking for the full source to a bootstrapping C# compiler, today’s your lucky day.

A while ago (back in 2001 before we shipped v1.0), I wrote a C# compiler called “Blue”. I know it’s 3.5 years after I wrote it, but I figured releasing it now was better late then never. Some fast facts:

– It’s written 100% in C#.
– It uses Reflection to import all references and Reflection.Emit to emit the IL.
– Everything (particularly the parser and lexer) were written by hand.
– It has the standard compiler pipeline as described in the dragon book.
– It produces verifiable IL (you can run PEVerify on the output and it passes).

This is where I’m supposed to act like a big tough programmer and say I’ll add a bunch of features to it. I’ll pass; but if someone would add some new features that would be great 😀

Advertisements

About James

I am a Senior Developer/Consultant for InfoPlanIT, LLC. I previously spent over 7 years as a Product Manager for what eventually became ComponentOne, a division of GrapeCity. While there, I helped to create ActiveReports 7, GrapeCity ActiveAnalysis, and Data Dynamics Reports.

Discussion

3 thoughts on “C# compiler written in C#

  1. Pretty neat 🙂 But he can’t have used Reflection.Emit for the whole stuff. He’d have to have generated the native stub on his own I guess

    Posted by Nish | February 8, 2005, 2:50 am
  2. Pretty neat 🙂 But he can’t have used Reflection.Emit for the whole stuff. He’d have to have generated the native stub on his own I guess

    Posted by Nish | February 8, 2005, 2:50 am
  3. Accidentally posted twice – if you don’t mind, let it be like that jus for historical purposes 🙂

    Posted by Nish | February 8, 2005, 2:51 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archive

%d bloggers like this: