BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News The First VB 8 Compiler Written in VB

The First VB 8 Compiler Written in VB

Rolf Kvinge has released a mostly functional VB 8 compiler written as part of the Mono project. Unlike Microsoft's VB compiler, which is actually written C++, this compiler was written in VB.

Like many projects, this one started out as a innocent conversation. His fellow classmates at Universidad de Belgrano were discussing how they were glad that they no longer needed to create a compiler in order to graduate. Sensing a challenge, Rolf set out to create a compiler for no other reason than no else wanted to. After a few false starts, he finally settled on creating a VB compiler in VB.

In his post Why?, Rolf discusses why he choose to write a 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.

XML Comments and support for the My namespace are currently not supported by the compiler, but should be available in a future release.

The source code and binaries for the VB compiler can be downloaded from the Mono website.

InfoQ Asks: Does it matter if a compiler for a language is written in that language?

Rate this Article

Adoption
Style

BT