Home   Archive   Permalink

Carl is listening. Would anyone like an Emscripten/WebGL port of R2?

An Emscripten/WebGL port of R2 would allow your existing R2 scripts, GUI and all, to run unaltered, directly in any mainstream browser, on any operating system, including iPhone and iPad, Android tablets and phones, Windows phones, WebOS, Gaming Consoles, and all sorts of other new devices yet to come - anything that has a modern browser.
If you'd like to see this happen, please let him know at the link below. I'd be willing to pay a few thousand dollars, and can likely get matching funds to help make it worth Carl's time, if he's interested.

posted by:   Nick     8-Dec-2014/21:43:22-8:00

Running some R2 apps inside a browser sounds exciting.
R2 exists on Windows, Linux and Mac. What we mostly miss are mobiles, i.e iOS and Android.
1/ I made HTTPhotos fits in a VGA screen, which is 640x480 and if it's OK for a tablet it is not small enough for a smartphone -> need to rewrite code for mobile.
2/ I'm currently writing some new templates for photography where I basically need next/previous buttons and it makes me realize we really need large buttons for mobile touch devices! It means that an app like HTTPhotos that uses some 20x20 pixels buttons is unusable on mobile without being... rewritten for mobile.
3/ What about speed? R2 is AGG based for 2D, how the port to webGL envisioned? If AGG is still used then I don't see how it will be GPU accelerated. If something else is used to be GPU accelerated, it means there are quite some work to port R2 View to webGL. Quite costly.
4/ What about filesystem access? My apps deals with files, how does it work from within a web browser?
5/ What about network access from a web browser? Can I read http:// ?
6/ There will be a nice "please wait" loading message showing for Rebol emscripten. Any idea of the size? Should take an average 10 seconds to load if it remains around 1Mb.
I want to stress that it's not going to be magic and could even be disappointing. Still, you're ready to spend thousands dollars for this. Why not spend some dollars for a native mobile port instead?

posted by:   GregP     9-Dec-2014/6:05-8:00

1) You'll need to make changes for platforms with different screen sizes, no matter what. The best answer is to do something like what Cyphre started to do with Android, to allow quick and simple automatic resizing based on a few changed variables. If more developers use the tool for real work, then such solutions to save repeated work inevitably get created by the community.
2) Cyphre's next interest was creating a mobile skin for Android, just like Doc did with the Win98 skin back when Rebol/View was first created. That just takes some design work by *someone. Once it's done, it exists for everyone to use, forever. And again, this sort of work has nothing to do with whether Rebol is compiled natively, in the browser, etc. That sits at the View/VID level.
3) There have been some amazing speed reports in projects ported using Emscripten. I've seen examples of 1.5x native speed, depending upon browser. For graphics, AGG will not be used in the browser. WebGL will replace it. Rebol is designed to be able to use different graphic renderers, more easily than other tools. With the Android port, Cyphre showed how effectively it could be ported to a foreign rendering platform. This part probably takes the greatest effort, and there's of course lots of work and learning curve involved for whoever does it, but the rendering technology is certainly capable of handling the sorts of development work for which we use Rebol.
4) Andreas already created a virtual file system using Localstorage, in his R3 Emscripten port. There are other ways beyond Localstorage (the QT port did such a thing).
5) This is one of the biggest things to see. I don't know about sockets, but there will of course need to be ways of getting data from app to server, and back. The normal mechanisms and routine may need to be adjusted, but a workable solution will have to be decided upon, and implemented by Carl.
6) We'll have to see.
OS platforms will continue to diverge in the future. HTML/CSS/Javascript is currently, and will continue to be, for the foreseeable future, the default accepted cross-platform solution, supported by every new OS. Not to mention, then we also get the ability to build "web pages" (not necessarily complex apps - just page layouts) entirely with simple Rebol code, entirely for free, with this port. Whether we like it or not, there's a whole gigantic world of users who only uses their computers in this way. Look at the popularity of things like Chromebook, and expect lots more of that in the future.
Sure, it would be great, in a world in which Rebol flourished, and had a huge community to work on multiple platform builds, to have native builds for every platform. But Carl is the only one able to compile R2, and this is our one chance to get an R2 version which will run everywhere for the foreseeable future. Even if the end result is less feature complete, slower, etc. (we don't know for sure by how much, at this point), just having it and being able to use the most important features of R2, and the enormous history of R2 code, everywhere, is extremely valuable to me. Even more important to me, if ports to new platforms aren't kept up, no new developers will ever become interested in Rebol, and the Rebol ecosystem will continue to just wither and die. An HTML/CSS/Javascript port is relevant and actually potentially useful to millions of developers - for all the same reasons that Rebol was originally conceived, and popular in its day. It's simple and productive - those qualities, to the degree which Rebol embodies, are not found in any other tool in the current scene. I'm sure there are many people who could and would choose to use Rebol if it existed on a modern and future proof platform,and I'd love to see some new blood in the community.

posted by:   Nick     9-Dec-2014/9:57:31-8:00

I agree with Nick; the Web is a "common denominator" for ALL platforms.
Don't forget the excellent work that is being made by Bo (http://rebolforum.com/index.cgi?f=printtopic&topicnumber=44&archiveflag=new ) in creating a html/javascript rebol dialect!

posted by:   Jma     9-Dec-2014/11:23:11-8:00

Thanks for your answers Nick, I appreciate your time and motivation. Our Rebol world doesn't have too much energy to spend. This debate to bring as many elements as possible to make a good decision.
I would say that Javascript is the real "common denominator".
Browsers understand with various degrees HTML, CSS, Canva, SVG, WebGL, but Javascript is the real single common language behind the scene.
Do we really want to add a "Rebol JS framework" load to a web page or a web app just because coding in Rebol is great? I mean, when the target is really the browser, why not just code in Javascript? And rather use Rebol to make a JS dialect like Bo is doing.
I can feel the excitement and I sincerely wish it would be the path to go.
I'm sorry for people who bought a Chromebook, but for others who have Android, iOS, Windows, Linux, Mac there are alternative web browsers and there is also an alternative solution to build a standalone web app and this is Rebol.

posted by:   GregP     9-Dec-2014/12:00:24-8:00