Tcl.js: robust, high-performance Tcl in JavaScript
Writing such a thing from scratch is pretty impressive - the twelve rules of Tcl syntax are readable (<a href="http:&#x2F;&#x2F;www.tcl.tk&#x2F;man&#x2F;tcl&#x2F;TclCmd&#x2F;Tcl.htm" rel="nofollow">http:&#x2F;&#x2F;www.tcl.tk&#x2F;man&#x2F;tcl&#x2F;TclCmd&#x2F;Tcl.htm</a>), but it&#x27;s up to you to figure out the edge cases!<p>As a different take on the same problem, I compiled Tcl to JS with Emscripten - <a href="http:&#x2F;&#x2F;aidanhs.github.io&#x2F;emtcl&#x2F;" rel="nofollow">http:&#x2F;&#x2F;aidanhs.github.io&#x2F;emtcl&#x2F;</a>. I also wrote a toy DOM library (<a href="https:&#x2F;&#x2F;github.com&#x2F;aidanhs&#x2F;emtcl&#x2F;blob&#x2F;master&#x2F;opt&#x2F;dom.c" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;aidanhs&#x2F;emtcl&#x2F;blob&#x2F;master&#x2F;opt&#x2F;dom.c</a>) which plugs into it which you can see demonstrated on the page.<p>One of the nice things about EmTcl is that you can include arbitrary C extensions by also compiling them with Emscripten, which is how the DOM library above works. As a more comprehensive demonstration, have a look at TclDis (<a href="http:&#x2F;&#x2F;aidanhs.github.io&#x2F;tcldis&#x2F;" rel="nofollow">http:&#x2F;&#x2F;aidanhs.github.io&#x2F;tcldis&#x2F;</a>). That has Tcl, a Tcl C extension I wrote for Tcl &lt;-&gt; Python communication, a Python interpreter and the Python script I wrote for performing Tcl decompilation all in the same page! (it probably won&#x27;t work well on a mobile browser)<p>Emscripten truly is incredible.