Home   Archive   Permalink

HTML/Javascript dialect by Bo

Bo has started creating a VID-like dialect which outputs HTML and Javascript. Basically, it lets you easily create GUIs which run in a web browser, using a familiar and light weight little dialect. This project deserves donations, and Bo will commit more time to it if that happens:

posted by:   Nick     26-Nov-2014/17:28:11-8:00

If you go to the above link, the source for both the %jsid.r3 script and the %test.r3 script are available. I'd appreciate any help cleaning up and optimizing the dialect script and also help with adding JavaScript functions for standard features like dragging, resizing, animating, etc. I've done many of these in JS before, but I'm a bit rusty and would have to dig through my archives to find working examples to adapt.
Also, I'm looking for any help in seeing if Topaz can be added to the dialect to allow scripting JS with a Rebol-family language.

posted by:   Bo     26-Nov-2014/18:03:14-8:00

Here's a donation link which goes directly to Bo:

posted by:   Nick     26-Nov-2014/18:31:26-8:00

I also posted a "Donate" button on the actual test.r3 script link posted above.

posted by:   Bo     26-Nov-2014/18:34:17-8:00

Then is it possible to create local applications with this dialect? (to encap the source code into an executable)

posted by:   Rex     26-Nov-2014/19:48:43-8:00

Rex, this is meant as a GUI interface for Rebol 3 that is designed to run inside a browser. The Rebol 3 code can be hidden from view as only the generated HTML and JavaScript are displayed. However, the HTML and JS are viewable, although the original Rebol 3 source is not.
In the future, it would be possible for this code to generate a .js file on the server so that only the HTML code would be visible. Also, if the Rebol 3 code is generated via CGI calls, then only the
element would be visible, and not the HTML or the Rebol 3 code.
I hope that makes sense.

posted by:   Bo     26-Nov-2014/21:26:07-8:00

Yeah.. I think I know what you mean. But I have also read about the software that can encap javascript or vbscript into an executable. So I am wondering if I can create a javascript with this dialect and encap it into exe.

posted by:   Rex     27-Nov-2014/1:20:57-8:00

Very interesting project!!
Many people will appreciate this; being able to write JS code using clean & simple REBOL; that's simply amazing!
Keep it up!

posted by:   Luca     27-Nov-2014/4:39:30-8:00

Bo, the Emscripten port of R3/Core may end up being a perfect match. In fact, for building complete front and back end web apps, a combination of the Emscripten R3 core port, and a future mature jsid project may be a viable alternative to a WebGL port of R3/View and R3-GUI.

posted by:   Nick     27-Nov-2014/8:06:58-8:00

One upon a time, there was Topaz:

posted by:   GregP     27-Nov-2014/8:37:45-8:00

Topaz could be a /core. Then something like jsid could be a /View.

posted by:   GregP     27-Nov-2014/8:43:47-8:00

I did make a humble contribution, not withstanding the lower value of Australian dollar today.
Perhaps later on, some budgets could be made and budgets and contributions published together. Budgets vs. Actual would provide a feedback mechanism between developers and contributors.
I think it would improve the flow of financial contributions.

posted by:   Felix     27-Nov-2014/22:06:41-8:00

I wonder if you could integrate w2ui or some similar library to give us data grid and other useful data management widgets. W2ui is MIT licensed, small, full of features, etc.

posted by:   Nick     28-Nov-2014/5:18:07-8:00

GregP: I looked into Topaz, but I can't find a way to hook Topaz into the DOM without doing a LOT of work to come up to speed on Topaz, and then more work to abstract it to work with the DOM.

posted by:   Bo     28-Nov-2014/17:13:14-8:00

Felix: First, thanks so much for the donation! My roadmap right now is to get a working and reasonably complete dialect done ASAP so I can get a few high-priority projects out the door. I have deadlines for these. However, after I have these projects done, I can work on a roadmap with budgets. I'm still fighting with how to abstract the dialect so Rebol and JS play together well after the page is displayed. Basically, after the page is displayed, the dialect and Rebol no longer have any control over the page unless a Rebol CGI script is called from within the page. I've thought about implementing the common datatypes and basic Rebol natives in JS so some level of JS functionality can be controlled with a subset of Rebol functions, but even that's a big job -- to big for the present projects I need to complete. So I'm looking at some JS cheats to make things easier than JS, although not quite as nice as Rebol.

posted by:   Bo     28-Nov-2014/17:20:14-8:00

Nick: W2ui looks like a great framework to include in JSID! There's a lot of features to it. I may not have time to implement W2ui until after the current deadlines are completed, though.

posted by:   Bo     28-Nov-2014/17:32:39-8:00

Even if the style of JSID ends up being messy and littered with some necessary Javascript, it's still really useful. What you've done already points to the possibility for a dialect which requires less mental gear shifting. In the long run, there's a lot of potential for this thing (and maybe, dialects to produce Java and other code...)

posted by:   Nick     28-Nov-2014/21:39:50-8:00

I just finished going through all the examples of w2ui. It looks pretty amazing, and quite close to the principles of Rebol. I think integrating this into the JSID dialect will be one of my top priorities.

posted by:   Bo     29-Nov-2014/2:13:48-8:00

I spent about two hours starting to integrate W2UI -- specifically w2ui's layout feature -- into JSID. Besides trying to abstract w2ui to the easiest and most flexible possible dialect, there's a lot more to it than what appears on the surface. I'm still working on getting the most basic w2layout integrated, but I think I have a good dialect abstraction designed. It's past my bedtime, so I hope to have a chance to work on it some more tomorrow.

posted by:   Bo     30-Nov-2014/3:23:53-8:00

Wow, I can't wait to see this

posted by:   Nick     30-Nov-2014/7:03:56-8:00

Just so you know, W2ui runs on more browsers than any comparable framework I've tried. Even on an old Android phone with a pre-Chrome browser and on lite mobile editions of mobile browsers, it degrades nicely.

posted by:   Nick     30-Nov-2014/7:20:15-8:00

Spent another two hours tonight (it's past my bedtime again) and got the first very basic prototype of w2layout working in JSID. However, I haven't gotten to the part where changing the content of the panels is possible yet, and there is a LOT of dialect code cleanup to be done, plus a lot more extensions that need to be made to the dialect to allow w2layout to be truly useful.
You can see it at http://video.respectech.com:8080/jsid/test3.r3
Please take note that the code listed on the above example for test.r3 and jsid.r3 are the old versions of the code and are not yet reflecting the new changes to allow w2layout to be integrated and working.

posted by:   Bo     1-Dec-2014/3:03:57-8:00

Just a note: I did make the panels resizable, so you can try to find the divider bars and move them. :-)

posted by:   Bo     1-Dec-2014/3:07:25-8:00

I'm a little giddy about the fact this is getting done (and working on getting some more donation matches).

posted by:   Nick     1-Dec-2014/11:17:27-8:00

Worked on JSID for about two hours again last night. Didn't make any visible progress, but started to create the ability to add JSID content into the w2layout object.
w2layout is VERY finicky about what it will allow in the "panel" JS array. What my test script is creating in HTML/JS right now looks to be in line with what I had working before, but it is not displaying for some reason when rendered in the browser. Haven't tracked down the culprit yet.

posted by:   Bo     2-Dec-2014/12:06:39-8:00

Oh how I love the tediousness of JS.
I finally tracked down the culprit that I mentioned in my previous post. There was a size of 50%, and that needed to be in quotes, but wasn't. Fixed that and it works again. Now I can try to get back to rendering some more complicated stuff in w2layout.

posted by:   Bo     4-Dec-2014/1:06:46-8:00

I have JSID rendering HTML inside of w2layout panels now. However, I can't get any JS to evaluate inside the w2layout panels. I seem to remember reading something somewhere that lead me to believe that inline JS won't work inside of w2layout panels, but now I can't find it, not for lack of trying.

posted by:   Bo     4-Dec-2014/1:53:04-8:00

Made some changes to the page at http://video.respectech.com:8080/jsid/test.r3 to show off some of the new features and provide more information, like a general roadmap.

posted by:   Bo     4-Dec-2014/3:05:48-8:00

I made an additional $100 donation. Looking forward to grid!

posted by:   Nick     4-Dec-2014/11:21:21-8:00

Just a comment (maybe it is not an interesting comment)
Several years ago, there was only Rebol/core. And there was a way to make GUI with a web browser (IE) using a Rebol/core plugin.
GUI was made on the client side with the combination of HTML and Rebol (analoguous with JS).
It was possible to use cgi to invoke Rebol on the server side.

posted by:   JeanLouis     4-Dec-2014/16:39:24-8:00

There was a plugin for both IE and Mozilla, but it's problems are exactly what we're trying to avoid. Modern development practices have moved away from plugins in the browser. Even Flash has lost its future potential. HTML/Javascript/CSS runs on every platform, on the web and as packaged web apps. This dialect just lets you quickly output HTML/Javascript/CSS, for example from a CGI script on a server, or from a scripting layer such as SL4a, or just from a locally running app, to provide totally portable GUIs, using a nice and familiar dialect. You should be able to run these GUIs on any modern PC, Tablet, Device, etc. which has a browser, despite OS, and without any plugins.

posted by:   Nick     4-Dec-2014/22:15:32-8:00

I agree with Nick. Although I've never been a fan of the huge amount of bloat that browsers inject into a system, they are a truly cross-platform graphical presentation layer. Unfortunately, all the content layout load goes onto the server requiring significantly higher resources at the server level when traffic gets high. But it is also a benefit because even slow devices with a browser can work well with this dialect.

posted by:   Bo     5-Dec-2014/9:54:03-8:00

Sorry I haven't had much chance to work on this lately. Hardkernel announced the ODROID-C1 shortly after my last post, and we've been overwhelmed by orders since then (like the type of overwhelming feeling you get when working 18 hours a day 7 days a week).

posted by:   Bo     27-Dec-2014/0:41:38-8:00

Congrats on the success of the ODROID! I hope you're still able to find time in the future to work on the JavaScript dialect...

posted by:   Nick     28-Dec-2014/12:41:24-8:00

JSID is the cornerstone of my future development in Rebol3, so I must complete it (at least to some basic level of functionality) as all my projects (and there are a lot of them) rely on it.

posted by:   Bo     28-Dec-2014/22:41:38-8:00

Made a couple of small updates to JSID, like addition of table support. Not really happy with it yet, but at least it's working.

posted by:   Bo     26-Jan-2015/11:26:04-8:00

I'm glad to hear this is alive!

posted by:   Nick     29-Jan-2015/11:08:50-8:00

CGI input is now also working in JSID. Working on adding more features now.

posted by:   Bo     23-Feb-2015/3:36:37-8:00

Rock and roll - this is so great to see!

posted by:   Nick     24-Feb-2015/9:42:42-8:00

Bo, where is the most current jsid.r3 file? The one at the test.r3 page is dated November 2104

posted by:   Nick     24-Feb-2015/10:55:25-8:00

Wow, sounds great. But does this require a mastery in javascript or html?

posted by:   Rex     26-Feb-2015/6:37:17-8:00

Nick: The most current JSID.r3 script should be at http://video.respectech.com:8080/jsid/jsid.r3 . If it looks old, you may have to refresh your cache.
Rex: Mastery in HTML and JS are not necessary, but it may help depending on what you are trying to do.

posted by:   Bo     28-Feb-2015/19:06:11-8:00

Working on adding transfer of state between pages generated by JSID so that cookies and other methods aren't needed.

posted by:   Bo     28-Feb-2015/19:07:42-8:00

Bo, http://video.respectech.com:8080/jsid/jsid.r3 gives 500 - internal server error, for the past few days.

posted by:   Nick     1-Mar-2015/8:34:58-8:00

Nick: That's probably because jsid.r3 doesn't output any data (it's just function and dialect definitions), so the webserver returns an error because there is no data. Probably the easiest way to get the file is to copy it out of http://video.respectech.com:8080/jsid/test.r3 .
(Incidentally, I looked at using encloak/decloak to encrypt the CGI state data, but it seems to fail to decloak if the data is over a certain size.)

posted by:   Bo     1-Mar-2015/22:18:32-8:00

x: copy {} insert/dup x "a" 10000000 append x "t" length? x
y: encloak x "yes"
z: decloak y "yes"
10 million and 1 characters encloaks and decloaks correctly. Can you post the examples you're attempting?

posted by:   Nick     3-Mar-2015/21:55:20-8:00

I was able to fix the encloak problem. It turns out that encloak/decloak can modify the contents of a series, so I had to use 'copy to keep that from happening.
So now JSID automatically transfers the entire system/dialects/jsid/cgi object through CGI compressed, encloaked and converted to base-64 so whenever another page is called, the state of the cgi object is transferred.
Also, I now have the very basics of w2ui's w2form functionality working in JSID, and will be expanding on that soon.

posted by:   Bo     4-Mar-2015/14:18:48-8:00

This is exciting. I'll write a tutorial for it when it reaches a state ready for production :)

posted by:   Nick     4-Mar-2015/22:05:16-8:00