BT

The First VB 8 Compiler Written in VB

| by Jonathan Allen Follow 632 Followers on Feb 27, 2007. Estimated reading time: 1 minute |

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 Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Does it matter if a compiler for a language is written in that language? by Floyd Marinescu

InfoQ Asks: Does it matter if a compiler for a language is written in that language?
I'm not sure if it matters as far as end users are concerned but historically writing a compiler in the language it compiles seems to be a sign of maturity.

Re: Does it matter if a compiler for a language is written in that language by Floyd Marinescu

Maturity of the langage that is.

Does it matter if a programmer doesn't know the languages he uses? by zqu dlyba

"... I thought it was a great change to learn it better ..."
"... After a couple of hours the myth had survived. The lack of inheritance in VB6 made me crazy ..."
"... now that I was learning the new Visual Basic.Net language ..."

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

3 Discuss
BT