It would also be nice to abstract or separate the webgl or graphic commands apart from the logic or syntax stuff, kind of making a headless or console version of it.
This one is pretty obsolete and still contains string.replace() where string.replaceAll() should be used. Better use the online version of BB2JS. Develop in blitz 2D, following the special rules for BB2JS, then copy paste the two parts (init and main loop job) to the browser at https://jfkeo1010etc.itch.io/bb2js-online-version . That said, it does not use WebGL, but plain 2D canvas commands.