VBNC Compiles Hello World on Linux

by Miguel de Icaza

Rolf's excellent Visual Basic compiler was able to bootstrap itself a few weeks ago on Windows, but it did not work with Mono yet.

The compiler needed the VB runtime to be upgraded, it required a few fixes in the way we handle interface implementation for generics in the Mono VM, the final bug today was reference file names with their proper casing.

Also Rolf's compiler contained a few MS-specific hacks in the compiler, but those are no longer necessary so this afternoon the VB compiler was able to build Hello World on Linux:


$ mono vbnc.exe a.vb
	
                                                  DEBUG RUN

Visual Basic.Net Compiler version 0.0.0.4706 (last write time: 05/09/2006 21:06:28)
Copyright (C) 2004-2006 Rolf Bjarne Kvinge. All rights reserved.


Starting Scan
Scanning file /home/cvs/vbnc/vbnc/bin/a.vb
File '/home/cvs/vbnc/vbnc/bin/a.vb' scanned in 0.118 seconds
7 lines and 115 characters in total.
After SCAN: True
Starting Conditional Compilation
After ConditionaL True
Starting Parse
Parsing file /home/cvs/vbnc/vbnc/bin/a.vb (1 of 1 files)
3 assemblies were loaded.
73 namespaces were loaded.
2129 types were loaded.
Starting Resolve
Starting Resolve
CreateImplicitTypes compiler (1 of 1 types)
ResolveType compiler (1 of 1 types)
ResolveTypeReferences compiler (1 of 1 types)
CreateImplicitMembers compiler (1 of 1 types)
ResolveMembers compiler (1 of 1 types)
ResolveCode compiler (1 of 1 types)
Finished Resolve
DefineTypes compiler (1 of 1 types)
DefineTypeParameters compiler (1 of 1 types)
DefineTypeHierarchy compiler (1 of 1 types)
DefineMembers compiler (1 of 1 types)
Starting Emit
Emit compiler (1 of 1 types)
CreateType compiler (1 of 1 types)
Creating: compiler
Created:  compiler
Assembly 'a, Version=0.0.0.0, Culture=neutral' saved successfully to '/home/cvs/vbnc/vbnc/bin/a.exe'.
Compilation successful

	

The "DEBUG" run is a tiny bit verbose as you can see, the results are mind blowing:


mono$ cat a.vb
public class compiler
shared function Main as integer
Console.WriteLine ("Dingus")
return 0
End function
end class
mono$ mono a.exe
Dingus

	

Am actually scared of trying to bootstrap on Mono, I do not know if there are enough pixels in my machine to build the 68,000 lines of VB that the compiler has.

Posted on 05 Sep 2006