How did it happen to get written?
Well, it started as something of an exercise, back around 1992. It's project name was BCET - Basic Compile to Expression Tree. I wanted to learn more about writing a compiler, and I wanted a compiler that made better use of the 386 than PDS did, which was not at all, and better use than VBDOS did, which is not much at all. Then came Visual Basic, which can't do console (command line) programs without jumping thru major (slow) hoops. And VB (in the 32-bit versions) uses Uni-code for all it's strings, effectivly wasting 1 byte for each string byte used. And VB also has multi-megabyte runtime DLL's that you have to have.
So, I wanted something better. I hunted around the web, and the only program that even came close was BCX, by Kevin Diggins. It's a nice program, but it just doesn't do things the way I wanted. And, it is not source compatible with all the programs that I have sitting on my hard drives. Everything else that I found was either incomplete, or interpreted or cost more than I was willing to pay, or something.
I decided to finish my exercise project. I set some goals:
Has to read QuickBASIC / QBasic / PDS / VBDOS source files as is.
Has to generate Win 32 bit console programs. Initially, anyway.
Does not need to support Graphics, ISAM, COM ports, or operations that are not compatible with protected mode.
I had the compiler complete to the point of generating expression trees some years back. I was stumped on how to write the code generator. Last December (2002), I was reading a paper on code generators that gave me the hint that I needed to write the code generator. By June, 2003 BCET was to the point of being able to compile itself correctly.