That was many years ago. So why has it taken so long to get a console in the browser?
Now enter the Rebol interpreter, written in C. There is a
A program that runs for 20 minutes solid without updating the UI does not sound very satisfying!
Even something as simple as this loop has no opportunity to update the UI, because if paused long enough to give control to the browser to gather input, it would forget which step of the iteration it was on:
loop 100 [ print "Enter a string:" n: input print ["You entered:" n] ]
The recent breakthrough was the result of me learning stuff, and even feeding back into the design of emscripten a bit. The implementation is rough, but programs like the above can work…and I believe even more elegant implementations are possible. There’s quite a long way to go, but the mechanic appears solid.
(Note: I should point out that systems which appear to be doing this generally are not. For instance, if you use repl.it you will realize it is spinning up interpreters on the server side and just echoing it in your browser’s screen–see the Network tab if you are wondering).
So, now what?
Now that a Rebol function can appear to have synchronous side effects, the field is wide-open for what a web application might do.
I’ll pick an example of something I think is kind of “lame”: Rebol’s Logo heritage could be used to do something like a turtle graphics. PEN DOWN, TURN 90, etc.
It is true that Rebol could be used to show a new spin on this–a PARSE rule that acted on data and the GROUP!s contained reaction code to move the turtle around. But I don’t think it’s new enough. I think the moment you put that turtle up people are going to say “oh, it’s logo” and not be looking for the nuances.
I know Nick of Nick’s Forum has expressed his belief that a Rebol2 GUI equivalent would be compelling. That might lead one to think that wiring up web UI widgets to a view-like dialect and implementing something like the old calculator demo except perhaps like Qooxdoo’s version. I do not feel motivated personally to do that.
So here’s where one has to put on the thinking cap. What can Rebol do in a browser that would be interesting?
This is not a product
I want to be 100% clear in saying that I think Rebol is still very much trapped in the idea stage. It has more questions than it has answers. I would still dissuade most anyone from using these techniques in any kind of serious large scale production. It is an unproven, radical, extremely-odd-to-the-point-of-seeming-careless methodology that makes strange bets. To my tastes it is more an art project than a science project.
So my angle is not how to sell this to people as a product. It’s how to get people interested in the questions it raises. I’d like to see a tutorial that gets people to the meat of what makes Rebol different quickly, that a programming sophisticate could absorb and go “hmmm, I never thought of that”. That’s the audience I want to speak to–not someone who doesn’t know how to write “Hello World” in 5 other languages. Because a beginner has a lot to learn before even starting to think about why someone would do something as “crazy” as Rebol.