TclDis is a Python(!) program to take Tcl bytecode and turn it back into the
original Tcl code. It's a helpful learning tool, especially with the use of the
web interface to follow the decompilation process.
- see the code at https://github.com/aidanhs/tcldis
- view the web interface at http://aidanhs.github.io/tcldis/
WARNING: the web interface may take up to a minute to load and requires a modern
browser - the latest versions of Chrome and Firefox have been tested. Mobile
browsers not recommended!
The reason for this is that it uses some of my other projects   
with Emscripten to provide a completely client-side experience - nothing is sent
to a remote server, it's all handled by a Python and Tcl interpreter running
inside your browser.
There are more details in the web interface itself, but here are some notes:
- decompilation is done by ~1k lines of Python - it's not big, and could be
easily ported to tcl by a motivated person
- pattern-matching is used to decompile - this is bad for being future-proof,
especially when optimisations are involved (as introduced in 8.6)
- the ~3.5MB gzipped .js file includes a Python interpreter, the Python stdlib,
a Tcl interpreter and a C extension to let them talk to each other - there are
instructions on how to explore this combination in the web interface 'more
I could sink much more time into improving this, but I've reached a point where
I'm happy to leave it now - hopefully you find it interesting.
 libtclpy - https://github.com/aidanhs/libtclpy
 empython - https://github.com/aidanhs/empython
 emtcl - https://github.com/aidanhs/emtcl