[Mono-list] C# Compiler can compile hello world!

Miguel de Icaza miguel@ximian.com
05 Sep 2001 21:11:58 -0400


Hey guys!

   Today the Mono C# compiler compiled for the first time a HelloWorld
application:

using System;

class sample {

	static void Main ()
	{
		Console.WriteLine ("Hello World!");
	}
}

   The program above is compiled into a native executable on Windows
that works (you can get this tonight on the next snapshot, or those
with CVS access can get the compiler right now).

   The compiler has support already for a bunch of statements and I am
actively working on the semantic analysis of expressions.  The above
is just the most sample and interesting program that I could get
compiling.  The framework for performing semantic analysis is pretty
much in place and just need to be filled in. 

   I took a bunch of shortcuts to get the above example working, so
not all expressions work fully yet (for example Member Access
resolution it by no means complete), but we are on the case.  

   Ravi has got the rest of high level elements on the language
generated now as well (the big missing part is everything related to
expressions which is the hearth of the work).

   Anyways, I am pretty excited, and wanted to share this with you
guys.  I also tried the following:

using System;

class sample {

	static void Main ()
	{
		while (true)
			Console.WriteLine ("Hello World!");
	}
}

    And it also does what you expect it to do ;-).  

    Ok, I am going to have dinner and come back to fill in more
semantic bits. 

Best wishes,
Miguel.