Tech News
← Back to articles

Wacl – A Tcl Distribution for WebAssembly

read original related products more articles

wacl

A Tcl distribution for WebAssembly or Javascript

This is a Tcl distribution for WebAssembly (webassembly.org). It enables Web developers to embed a Tcl interpreter in the browser and integrate Tcl with JavaScript. It enables Tcl developers to use their tools and language of choice to create client side web applications. It enables all developers to reuse a great and (over decades) grown code base of useful packages and scripts, such as Tcllib, to be used in web browsers.

It is an extension of the Emtcl project from Aidan Hobsen, which can be found here. 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. 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

... continue reading