Post

BASIC - Status as of 2011-06-27.

I still don’t have a name for the BASIC project I’m working on; however, would like to share some of the progress I’ve made.

Parser (technically a scanner/ validating parser) layer is far enough along that I think it will be pretty simple to continue to add additional keywords to it without any major redesigns involved. This has taken the most amount of the overall projects time; as I’d hope everyone would suspect. It’s got to be right and it’s got to be fast.

Switched the project from Windows Forms to Silverlight and had to fix the 100+ errors introduced because of the limited nature of the Silverlight CLR. Built a test harness that would allow interactive testing of the Parser. This provided me a little bit of room to experiment with syntax highlighting using the Silverlight RichTextBox control as a proof of concept. Once I got this working, on to the next phase.

Built a Display object that would allow me to separate the implementation of the display away from the actual implementation afforded by the platform. The goal is to reproduce the experience of DOS within Silverlight with the possibility of doing the same through Windows Forms, “Windows8”, WPF, XNA or whatever else may come along. To do this, I’m doing a per-pixel implementation rather than leverage the ability to render Silverlight specific objects. Yes, this even means that I’m drawing my own fonts. ;-)

Once the initial Display object was done, moved on to creating an “IDE”. Initially, for nostalgia sake, I’m working on recreating the GW-BASIC experience. Where I go from there is left to a future decision. Pretty much got that working, now on to the Command Parser.

The Command Interpreter (which leverages the Parser) is still in it’s infancy; however, commands like LIST, KEY, NEW, etc. are working as well as the “editing” functions associated with the source list.

So all in all, not bad progress; however, this is the point where I think things will begin to slow a bit since it’s all about implementing the various keywords as well as beginning work on the actual interpreter. I’ve already build a rough interpreter in the Windows Forms implementation; however, this time I’m putting a little more thought into it.

The key thing I’m keeping in mind going forward is trying to keep separations of concern in mind as I design things. I caught myself wanting to add validation logic in the scanner/parser for a range of a parameter… which should be done at the compiler/interpreter level since the purpose of the scanner/parser is to just “parse” the text into a token tree. It’s up to “something else” to verify that the parameters are correct. (Some could probably argue this, however, at this time, this is the way that I’m designing it. We’ll have to see if I change going forward or not.)

Thanks for following along, see you in the next update.

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