Post

Back to BASIC!

Before I make an announcement, I have to make it abundantly clear that I’m a huge fan of Microsoft Visual Basic and do not have any significant complaints on where Microsoft has travelled with the language and, without risk of violatinig NDA, where Microsoft is planning on going. I also have to state that I do own stock in Microsoft (as it turns out, it’s the only company at this time that I do own stock with); so kind of provides an idea of the faith that I have in the team at Microsoft working on the language and tools that make up Microsoft Visual Basic.

With that said, I’ve been interested in some time about how compilers work and what is involved in building them. I also have been, again for some time, very sad that BASIC is no longer shipping with the OS. It just seems like something has been missing. I’ve also had several people approach me recently proclaiming “I want to learn how to write software.” It got me to thinking, “where do they start?”.& & So my initial reaction was to think about what was already available on every persons computer. The web browser! So without meaning to insult those that make a living building HTML, I don’t really consider that a “programming language”; to me, it’s a document and I do have to tip my hat to those that can build beautiful pages working with HTML/CSS. However, there is this thing called JavaScript (or JScript if you prefer). The problem is that in order to write an “application”, you will have to learn at least a little bit of HTML (concepts and tags), possibly some CSS (could skip, but hey, you’ll know it’ll be there eventually), the JavaScript language and all that entails as well as possibly having to learn something about the DOM. Wow! What ever happened to just being able to…

1
10 PRINT "HELLO WORLD!"

… execute it and it provided immediate feedback? Because of it’s simplicity, you could experiment and “play”. What ever happened to “playing”? I remember a time with writing code was fun. Now it seems to be a world of “if you don’t write it this way, it’s crap” and you have to learn several technologies, concepts, programming best practices, etc. before you can even begin to get the computer to bend to your will.

So it got me to thinking. At this point, it was just thinking…

Then I remembered the Microsoft Research project called SmallBasic. Interesting concept. Disappointed in a couple of respects; one in particular is the usage of square brackets as indexers on arrays. I wouldn’t have a huge problem with this if it wasn’t for the fact that the environment has a pretty large button called “Graduate” that is supposed to convert the “project” to a Microsoft Visual Basic project; which, of course, VB does not use square brackets for array indexers. So for the inconsistency and the fact that it also will not translate TextWindow.WriteLine("Hello World") to Console.WriteLine("Hello World"), I have to express a little bit of a level of disappointment. I will say, regarding SmallBasic, I do like some of the intellisense-esque stuff they are doing. It is pretty simple to get started and, again, I love the concept. I suspect that it was built by someone that was not from a BASIC background, and for that, I might be a bit critical.

Additionally, I have David Ahl’s book circa 1978 called Basic Computer Games. It appears that he updated the material for SmallBasic and has a sample chapter on his site that I could use to compare the new with the old. The new game in the sample chapter is something like 790 lines of code while the original is something like 45. Huh? OK, after digging a little deeper, it appears that the code is not a literal translation and contains a few bonuses; but still… 45 lines to 790 lines?

So, again, it got me to thinking.

What would it take to return back to my roots so to speak and have a very simple version of BASIC on top of the .NET Framework? Would there be any value in doing so? After a bit of research, experimentation and thought, I’ve decided that at least I would find this valuable if for nothing more than the learning experience that it would have. So with that said, I’m officially working on BASIC for .NET. There’s not a whole lot of “Visual” and I am starting with the original Dartmouth& documentation (circa October 1, 1964) as the “language spec”. Once I have this& milestone done, who knows where I’ll take it next. Actually, for full disclosure, I already have a few ideas. ;-)

As a side note, all& I can say is WOW! It’s amazing to see where BASIC started and where it is today. Just think, it’s only a little over 3 years away from being& a half a& century& of history. BASIC has also kept the name intact throughout all of these years. Contrast that with CPL, Basic CPL, B, C, C++, etc. (No, BASIC isn’t the oldest, longest running language, I think FORTRAN holds that title… and yes, there is a version of it for .NET (Fortran 95 spec I think.), but it does predate C by almost a decade.)

So one day soon, you’ll be able to build a source file with a .BAS extension, pipe it through a compiler and run an executable (.NET assembly) that consists of:

1
2
10 PRINT "HELLO WORD!"
20 GOTO 10

I’ll also be discussing topics related to this project as things progress.

I will have to leave this with a note. Some may wonder why I would choose to use BASIC as a basis for the language when building a compiler… the answer is… “Because.” and leave it at that. It’s my compiler and I can do it however I want. ;-)

This post is licensed under CC BY 4.0 by the author.