QBJS - QBasic for the Web

Started by dbox, May 16, 2022, 19:01:53

Previous topic - Next topic

dbox

Hi all,

Just wanted to share the QBJS project that I've been working on.  QBJS is an effort to bring the fun and accessibility of the classic QBasic syntax to the modern web browser.  The project is heavily inspired by both QBasic and QB64.  We've just released our fourth beta release.

Try it out here:
https://boxgm.itch.io/qbjs

Learn More:
If you are interested to learn more I'm trying to document as much as I can on the project wiki on github.  Here are a few pages of note:

  • QBasic Language Support
    This page describes the overall approach, what differences exist to QBasic/QB64 and features unique to QBJS
  • Supported Keywords
    Lists the set of keywords supported by the current stable release and the level of compatibility with QBasic/QB64
  • Samples
    A centralized place for QBJS code samples.
  • Project History
    From the the QB64 forum

I am very interested in any and all feedback!

Qube

That is really cool 8) Good to see the old classic BASIC languages in action still.

I did have a nosey at the code which breaks up the syntax ready for parsing but a big gust of wind just blew that right over my head :)) Must get around one day to concentrating on how that side of things works.

Excellent work though, very impressive :)
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

bplus

#2
+1 dbox doing amazing work with QB64 like code. More and more I can copy paste code in and it runs in Internet Browser without much modification needed. Should be able to start testing Very Simple GUI for QB64 in QBJS fairly soon.

@dbox can we load fonts yet?
1 person likes this

Aurel [banned]

+1 too .
I like it and most programs from qb64 work well in QBJS  ;)
(Y)

guest8544

Is there a way to use it as a JavaScript library?

dbox

Quote from: bplus on June 16, 2022, 17:23:49
+1 dbox doing amazing work with QB64 like code. More and more I can copy paste code in and it runs in Internet Browser without much modification needed. Should be able to start testing Very Simple GUI for QB64 in QBJS fairly soon.

@dbox can we load fonts yet?

Thanks @bplus!  We haven't added the extended font functions yet (just good ole FONT 16 at the moment) but I'll put it on the list to add for an upcoming release.

For the current release (in addition to a bunch of new QB45 and QB64 keywords) I'm really trying to focus on improving the syntax parsing and error reporting so its easier to do your work right in the browser.

dbox

Quote from: Tomaaz on June 18, 2022, 11:06:29
Is there a way to use it as a JavaScript library?

Yes, I suppose you could.  The easiest way to see an example of this would be to write a simple program at https://qbjs.org, click run and then take a look at the generated javascript in the Javascript tab of the bottom right panel.  To take it a step further, we have an export feature that lets you compile your program to Javascript and include all of the necessary html resources to run the program in a browser standalone, without the IDE.  You can access this feature from the Share button.  Once you select a mode of "play" or "auto" an Export button will appear.

guest8544

I see. BASIC code is not interpreted in real time. You need to  compile it first and then add the produced JavaScript to  your site. That's not what I was thinking about. Thanx anyway!

dbox

Hi All,

Just wanted to share some QBJS news with you.  We've just released the next beta version (0.5.0).  Here are some of the highlights for this release:

Data / Read / Restore
Full support has been added for standard QBasic data operations.

Parsing Updates
This release has a number of improvements to the parser which allow for more flexible formatting. There is now much less reliance on white-space placement for proper parsing of the source code.

Error Reporting
Parsing and runtime errors shown in the console output window are now clickable links which will highlight the corresponding line of code in the editor.

Expanded Set of QB/QB64 Keywords
35 new keywords have been included with this release.

See the full release announcement for a complete list of fixes and enhancements.

Check it out online here:  QBJS