cd jimtcl emconfigure ./configure --without-ext="aio load signal" --disable-shared --disable-lineedit emmake make mv jimsh jimsh.bc emcc jimsh.bc -o jimsh.htmlNow load up the jimsh.html page in your browser (e.g., file:///home/user/jimtcl/jimsh.html). This page has a rudimentary dialog box for standard input. If you have time, you might try interfacing with one of the nicer repl webpages, see the Emscripten wiki for examples.aidanhs I created http://aidanhs.github.io/emtcl/ a while ago. It shows both Tcl and JimTcl running in the browser. In addition, it comes with an extension to Tcl for manipulating the dom with inline JS - https://github.com/aidanhs/emtcl/blob/master/opt/dom.c
Wacl is a Tcl distribution for [WebAssembly]. It enables Web developers to embed a Tcl interpreter in the browser and integrate Tcl with JavaScript.It is an extension of the Emtcl project. But Wacl takes things a few steps further: it integrates a fully featured Tcl interpreter into the webpage and adds the following features:
- A main tclsh interpreter and capability to get it via JavaScript
- An event loop to process all Tcl events (timer events, fileevents, custom events)
- Client sockets. The socket -async ... command connects to websocket servers with the binary protocol. Then the resulting handle can be used to transmit binary data as with normal TCP sockets.
- The Tcl library: modules and packages in the Emscripten virtual filesystem. You can add your own packages!
- Proper initialization via Tcl_Init()
- An extension to call javascript functions from Tcl
emscripten is an interesting idea, but the concept of compiling Tcl, a very high-level language, down to an "assembler" version, also implemented in a high level language, but not using most of the features of it, just seems wonky to me. Would it not make more sense to implement Tcl as a transpiler taking it's high-level lists, dicts, namespaces, and other such notions directly into javascript, which also implements all these features - albeit as ugly as hell. It seems to me that taking javascript libraries and implementing only a scanner, it shouldn't be hard to "compile" to js source. Larry Smith