FireTcl
https://sourceforge.net/projects/firetcl/
FireTcl is a new way to develop desktop applications using web technology and Tcl.
It embeds a Tcl interpreter into Firefox.
FireTcl gives you the possibility to eval Tcl code in the user interface thread or in a browser worker. The Tcl code evaluated can execute also javascript and interact with the DOM.
The advantages of using web technology are:
AMG: How does this compare with the Tcl/Tk plugin?
FireTcl: It seems that the plugin uses Netscape Plugin API. I use a very simple approach: I use the XPCOM component js-ctypes for interoperability with the interpreter. Also I use coroutines for emulating interactivity: coroutines saves the state of an evaluation and returns a javascript code to eval or a signal indicating success with a return value or error with information about the error.
Behind the scenes js-ctypes uses the library libffi. This means that each time that a user makes a call to Tcl all passed arguments from the browser are converted from the native form to a C type value. And the returned value from the call is converted from a C string to a javascript string.
What are the advantages of this approach? - It's very easy to maintain and to understand. This point is important for a long life project. - The user don't compile nothing. The only requirement is the dynamic library to Tcl. - It works for all Tcl versions - It uses a library that seems that firefox will always guive support: js-ctypes - The user can eval Tcl on a worker. And there is no requirement of a Tcl with threads enabled, because the thread library is not used. - It works for all platforms with a firefox and a Tcl interpreter - You can call javascript and manipulate the DOM:
::FireTcl::eval_javascript {alert("hello world!")}
Another possible approach for guiving support to the other browsers (Chrome, Internet Explorer,...) is to uses a local server and make all the requests for Tcl evaluation to this Tcl server. PHP Desktop uses the same idea:
https://code.google.com/p/phpdesktop/
They uses Mongoose as the web server.
One possibility is to uses a Tcl websocket server for doing efficient calls and for bidirectional communication.
This other approach using a local server is a complement to my approach for guiving support to the other browsers. But FiteTcl is a little bit more efficient.