Version 9 of RAPL

Updated 2011-12-10 16:16:15 by apw

RAPL is an acronym for Rapid Application Programming Language.

Right now it is Tcl Parser in Javascript (similar to the parser in incr Tcl in Javascript), which produces a binary struct like meta representation of the parsed input. Maybe in the future there will be some extensions to standard Tcl. It will not support all of Tcl, it will support that part of Tcl, which can be run in a browser environment.

The meta information is built using ArrayBuffer and DataView (typed arrays )

It is a work in progress started at November 2011 by apw.

The idea is to have some code (in whatever language C/Javascript/others) which can do optimisation on that meta representation and then have a backend (again in whatever language C/Javascript/others) to interpret the meta information.

The first first version will be: also the backend (interpreter) will be in Javascript and it is planned to use that eventually as a general possibility to run RAPL/Tcl input in a browser and on smart phones.

apw 2011-11-20: the results of the experiments with the meta information were not as interesting as I thought, so I am now experimenting with reimplementing a part of Jim in Javascript. Parsing and storing of token list in script tokens is working mostly. Now experimenting with either using execution part of incr Tcl in Javascript or use more code from Jim.

The meta information part is still available/usable in parallel for eventual later experiments. The parser part can either be used for producing meta information or for producing Tcl_Obj information like in Jim.

apw 2011-12-04: first statements are running. Use of Tcl_Obj is done as in Jim (the equivalent of Tcl_Obj there is Jim_Obj). Be aware, that Jim_Obj is not identical to Tcl_Obj (see Jim documentation for that).

There are a lot more obj types in Jim like sourceObjType, scriptObjType and scriptLineObjType and a lot of others, which I find very useful.

For locating and administrating variables I will use mostly the parts from incr Tcl in Javascript namely callframes (a little bit different to Jim_CallFrame) and namepaces, as that provides more stuff needed for itcl/snit functionality in itcl as in itcl-ng than the namespace implementation of Jim.

So parsing, tokenizing, use and handling of Tcl_Obj's and "objectifying" is mostly done as in Jim. Also a lot of the Tcl_Obj Evaluation is identical to Jim.

apw 2011-12-10: did some simple performance analysis: setting a variable and setting a variable with the value of another variable. Looks not so bad. RAPL compared to Tcl 8.6 head using js shell from mozilla spidermonkey for RAPL is "only" about 25-30 times slower, which seems to be an advantage compared to JimTcl against JimTcl compiled to Javascript using emscripten done by Steve Landers, which showed a factor of 50-80 times slower for the latter. I hope that this comparison is generally OK.

Stay tuned!