Re: Tcl bytecode



On Tue, 30 Jan 2007, Larry W. Virden wrote:

What makes it loading byte codes so much slower than loading tcl source? That seems counter-intuitive. Is the byte code mechanism just too complex?

When you run plain-text source, you have to parse the code. When you run byte-compiled source, you still have to parse the code, because you can't trust the byte-code to be untampered. Take for example hex editor and change some bytes in some plain .exe executable and see it crash and burn and wreck havoc when you run it. Trusting anything is just a big no-no.

Probably Tcl wouldn't wreck that much havoc even with tampered byte-code, but you can bet who would be blamed if it would. Not the tamperers, no.

As Tcl does on-the-fly compilation of source at runtime byte-code would speed things up only if it could be trusted. And it can't so there is no way it could be faster.

--
-Kaitzschu
s="TCL ";while true;do echo -en "\r$s";s=${s:1:${#s}}${s:0:1};sleep .1;done
.