December 2, 2005
NG-BASIC for Javascript |
NG-BASIC is a BASIC interpreter written in Javascript, by Navaho Gunleg (hence the name NG-BASIC).
This means it is basically platform independent, were it not that Firefox 1.5’s Canvas object is required for graphics-support. You’re missing out on some great stuff if you don’t use Firefox already!

This project originally started out as a silly proof-of-concept and, like with many things, it quickly grew seriously out of hand. Chances are nobody will be even using it. Ever. But please let me know if you do. My ego loves that.
Well, when I wrote the above I didn’t expect the link to this page to spread like a fire. Thanks for your interest and bug-reports!
By the way, this project has nothing to do with ngBasic, a PASCAL BASIC implementation which I discovered a while ago (that project seems pretty stale, though).
NEW You can download the 0.2.16 version (modified to work from Firefox as an extension) right here.
Demonstration
Note that these open in a popup-window.
- Click here to start the BASIC interpreter (version 0.2.14).
- Click here for the version with a larger font.
- Click here to start the cutting-edge development version (new features, but may be broken).
Available Programs That Work
Currently, the virtual filesystem on this server hosts a few test-programs and works-in-progress. Check the `Sample BASIC programs‘ section for an overview of which programs are available.
It’s worth noting that, on the virtual filesystem, a menu-application is available: use RUN MENU to load & run it, or click here.
Features
- NEW NG-BASIC can now be installed as an extension in your Firefox browser!
- NG-BASIC now contains graphics support through the Mozilla Canvas object. Yes, you read it correctly: graphics. It will enable one to draw lines, circles and rectangles. Thanks for the hint, Daft!
- The BASIC interpreter supports
SAVE&LOADthrough AJAX. Because of theXmlHttpRequest( )limitations, one may only load & save files from/to the website that the interpreter is hosted on. ForSAVE-support, one needs a password, though — without it the webserver will not store the program.
Notes
As suggested by reader Douglas, `Firefox users should disable the “Start searching the page for text as soon as I start typing” feature. If they don’t, the first character they type into the window gets echoed properly to the screen but all chars after that one get captured by the find window that opens at the bottom of the screen and never make it to the Basic client window itself‘.
For quite some time, there also this irritating thing occured when, for instance, the ‘/’ key is pressed, as this opens the ‘Find’-dialog in Firefox-derived browsers. I figured out why it did this and this isn’t happening in version 0.2.14 (well, as long as you don’t keep it pressed).
I also ignore the F5-Reload key as to prevent an accidental loss of a (long) typed-in BASIC program.
Known Bugs
- Only confirmed running in Firefox 1.5.x, 2.0alpha1 and 2.0alpha2.
- Probably more. Let me know if you encounter them.
ChangeLog
To save space on this page, the ChangeLog is kept over here.










