In-browser BBC BASIC for SDL 2.0

New releases of BB4W and BBCSDL, and other updates, will be announced here
michael
Posts: 43
Joined: Mon 02 Apr 2018, 17:13

Re: In-browser BBC BASIC for SDL 2.0

Post by michael »

giving you an option for deploying programs that you've written and tested conventionally on a desktop platform
And that is why it's so attractive. People only need ONE link and no need to download files and manage them. Its simple. I love the interactive site advantage it gives you. (aside from needing to wait for the browser to load the program in the link its worry free and that is hardly an issue.) I keep thinking there could be another way to empower BBCSDL from within a device to run a program from a dropbox link without needing to download it to a folder.

* and if you could do that you could also navigate to other links within a program and have efficient web page interactivity option without actually using a browser ( if you know what I mean. You would be giving BBCSDL web site abilities )
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

michael wrote: Sat 26 Sep 2020, 15:06I keep thinking there could be another way to empower BBCSDL from within a device to run a program from a dropbox link without needing to download it to a folder.
But that's not OS-agnostic so you would have to create (and maintain) a separate binary for every platform, provide different download links for every platform etc. It's the sort of approach that works for Windows, and which indeed BBC BASIC for Windows makes easy (because it builds single-file standalone executables), but not in a cross-platform environment. Security concerns also make such an approach increasingly unacceptable.

The in-browser method solves all those issues, or it would if the capabilities that BBC BASIC needs were more widely supported. Currently the desktop versions of Chrome, Edge, Firefox and Opera work (with more-or-less consistent results) but Safari doesn't and nor do mobile browsers. I expect that as mobile devices get faster CPUs their browsers may become more functional, but whether Apple will ever decide Safari should play along is another matter.
mikeg
Posts: 101
Joined: Sat 23 Jun 2018, 19:52

Re: In-browser BBC BASIC for SDL 2.0

Post by mikeg »

* I am happy that you have provided a BBCSDL for web on your site. (for as long as it is available. It really is awesome.)

On the idea of making a web site hosting version of BBCSDL (as mentioned above):
Security concerns also make such an approach increasingly unacceptable.
That was a concern I figured would be brought up. BUT if say, a version was made that only allowed interaction with the content of the presentation from the link and didn't allow a person to say, snoop in a persons computer or say, write to the users device, then such concerns could be avoided.

Again, I am very happy with the web version.. I will be making more presentations for this version.. (efficient interactive presentations)

Thanks Richard.
Focus is on code subject. Feel free to judge the quality of my work.
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

mikeg wrote: Sat 26 Sep 2020, 20:50BUT if say, a version was made that only allowed interaction with the content of the presentation from the link and didn't allow a person to say, snoop in a persons computer or say, write to the users device, then such concerns could be avoided.
No, you misunderstand. It's got nothing to do with the security of your program or mine but that many people will not (and increasingly cannot, for example because of company policy) download and run binaries on their own PCs. Macs are probably leading the way in this, and with each new release of MacOS it becomes more difficult to override the security warnings. But even in Windows it is likely that the user will be warned that the program may be harmful, and you can hardly blame them for not being prepared to bypass that.

Browsers are another matter. They present a secure sandboxed environment to which you can download and run an application in complete safety, the worse thing it can do is probably to gobble up lots of CPU time. Of course there's a downside, the app cannot access your local filesystem, or even the clipboard, because of the sandboxing. And because it's executed in a secure language (WebAssembly) rather than using native machine code it is likely to run considerably slower. But for some applications that probably doesn't matter.

But you are right to be concerned about availability. At the moment my in-browser BBC BASIC is off-line, not through any action of mine but perhaps due to running out of quota at my hosting service, or more worryingly through malicious intent. A couple of days ago somebody was accessing my site dozens of times a minute, probably with the intention of carrying out a small-scale DDoS attack; I have now blocked that (fortunately it was all coming from the same IP address) but the in-browser edition is of course much more vulnerable to this.
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

The latest update to the in-browser edition of BBCSDL incudes the following programs in the examples/games/ directory: buggy, dibley, dropperz, hangman, jigsaw, lemmings and snake. In order to keep the initial download size manageable, these are provided only as stubs which automatically fetch the programs and their resource files 'on demand'.
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

I'm slowly working through the example programs adding ones that can work in a browser, but which need to be downloaded 'on demand' because they use reasonably large resource files that would bloat the package if included. The latest such is SkyBaby.
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

Latest additions: fluid.bbc, mandel.bbc and slitscan.bbc, in the graphics directory.
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

... and not forgetting the remarkable seascape.bbc.
michael
Posts: 43
Joined: Mon 02 Apr 2018, 17:13

Re: In-browser BBC BASIC for SDL 2.0

Post by michael »

... and not forgetting the remarkable
I looked at this and I am amazed. I just wonder how far the in browser version can evolve. Perhaps a talk with google to preserve it into the future is in order. Or maybe Firefox or some other browser. They would have to host this as you are doing, but technically, if they supplied the same level of bandwidth they use for other things, virtual programming on the web could become easy and a norm.

There are always strings attached with arrangements of this sort. I don't know if a person could trust them. It couldn't hurt to also contact the CEO of apple to see if something could be arranged to host BBCSDL in the app store ( and maybe even open the door to the browser version)

The only way to find out is to inquire. * You never know, the CEO of Apple might be interested.
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

michael wrote: Tue 06 Oct 2020, 02:51 I looked at this and I am amazed.
The reactions I have had to seascape.bbc running in the browser have been puzzling. There's nothing in the least surprising (let alone amazing) about it: it's a shader demo (one of those supplied as examples with BBCSDL for the last couple of years) and since browsers run WebGL they are no less capable of running shader programs than any other platform with a GPU.

The only reason it took me a little while to get them running was that the BBCSDL shader demos use the OpenGL / OpenGLES 1.1 Fixed Function Pipeline (because it was convenient to do so, and it's something I'm familiar with) and since WebGL emulates OpenGLES 2.0, which doesn't support the FFP, I had to rewrite them not to use it. The absence of the Fixed Function Pipeline is also why there are no 3D demos.
Perhaps a talk with google to preserve it into the future is in order. Or maybe Firefox or some other browser.
Huh? What it needs to preserve it is for somebody to take over responsibility for BBCSDL after I no longer can, which will be quite soon. Nobody has yet come forward. :(
It couldn't hurt to also contact the CEO of apple
Ha ha. Sadly Apple forbid programming languages in the App Store, as you know.

The in-browser edition has long been the 'missing link' in the cross-platform BBC BASIC for SDL 2.0 family, and it's fortunate that the necessary functionality has appeared in mainstream (desktop) browsers just in time for me to implement it before my health declines too much. It took quite a lot of effort to get the kinks out so it would actually run, but that's as much my inexperience (and difficulties resulting from my cognitive decline) than anything else.