Thursday, February 22, 2007

Why?

Why did I write a compiler?
When I was studying computer programming at Universidad de Belgrano, one of my fellow students mentioned that "at least they don't require us to write a compiler anymore", making reference to earlier years when the students seemingly were required to write compilers in order to finish their degree.
This obviously made me want to write a compiler, not to finish my degree, but to only satisfy my geeky desire to do something nobody else wanted to do.

Why did I write a compiler for Visual Basic.Net?
Visual Basic was the first computer language I learnt (way back at high school in '98 I got my hands on VB4, later on it was upgraded to VB5 and then VB6), and I did actually like it (no comments on this one please :) .
Later on I started learning C++ (but I didn't like it since the relation between "tangible results"/"amount of code written" is way lower than for VB - in other words it took me far longer to do the same thing in C++ than in VB), and Delphi (which after about half an hour of trying things out the compiler started throwing internal errors at me, so I figured Delphi wasn't the language for me either).
This happened about the same time as the first beta of VS2002 came out (VB7/VB.Net), I had ordered a copy so I was trying it out and learning about the new VB.Net language, and I liked it way better than the previous editions of VB, so the choice wasn't really that hard. Besides, I couldn't find any other VB compiler (non-MS and compatible with MS' version of VB) out there, so it always feels good to create something new :)
The original intention was to write a compiler that compiled VB.Net into native code (I did actually get it produce a HelloWorld.exe, it was however mostly hardcoded into the compiler), but when I got to learn more about the managed world I realized that the intelligent thing to do would be to create a compiler that compiled IL to native code and therefore targeting several languages in one hit. The amount of document-reading required to do this (I would have to learn IL, assembler, the PE file format...), made it completely uninteresting, so I rescoped my project into creating a compiler to compile VB.Net into IL, just as vbc.exe does it.

Why did I write the compiler in Visual Basic.Net?
It didn't start out like that, I first tried C++ (yes, even though I didn't like it, but I thought it was a great change to learn it better and maybe make the mentioned result/work relation better). You can actually still see this in the code (check out the comments at the end of this file). The effort didn't last much though, after a couple of days of debugging memory leaks and seeing weird compiler messages all the time I got bored and figured I'd have to change the source language if I was ever going to finish anything at all.
Next try was VB6. I'd read everywhere that no sane person would write a compiler in VB6, so I decided to kill that myth. After a couple of hours the myth had survived. The lack of inheritance in VB6 made me crazy, I saw myself either copy-paste huge amounts of code, or write it all in functions, with no OOP whatsoever, neither very pleasant alternatives. Especially now that I was learning the new Visual Basic.Net language. Once again, the choice wasn't really that hard.

Tuesday, February 20, 2007

My Name

Hi there!

I'm the guy behind the new vb compiler for Mono and my name is Rolf Bjarne Kvinge.  Yeah, that's right, you're probably not going to be able to pronounce it unless you know some scandinavian language (not even my wife can). And for the record: I have one first name (Rolf), one middle name (Bjarne) and one last name (Kvinge). Especially people from the Spanish-speaking world think I have one first name and two last names (it probably comes from the fact that in Spain everyone gets two last names, one from the father and one from the mother, and if you have only one, it's sort of like you don't know who is your father...).

You have no idea how many ways I've seen my name spelled and pronounced (and even though I really think my first name is really easy to spell), though Raulf Jarve is one of the better ones (you'd think journalists would spend more time on checking these kind of things, but this one obviously didn't - if google returns 2 (two) results for it something should tell you there's something wrong).

When I was living in Brazil they pronounced my name something like "Houlfi", in Argentina/Spain it's like "RRRRRRolf", in English it's with the English "R", it's only the French that is able to pronounce my first name more or less the way I do in Norwegian... and here in Spain I normally have to spell even my first name for them to be able to pronounce it (normally it will be either turn out Raul, Ralph, Rodolfo or Rudolf otherwise), but then they normally get it right.

Regarding my middle name and my last name I've learnt that it's completely useless to try to teach anyone how to pronounce them, so just call me Rolf, ok?