Re: Tcl bytecode
- From: Jeff Hobbs <jeffh@xxxxxxxxxxxxxxx>
- Date: Tue, 30 Jan 2007 08:31:34 -0800
Googie wrote:
suchenwi wrote:With TclDevKit ($$) you can save bytecodes to a file (and load them with tbcload). However, their purpose is to obfuscate code, and loading them is slower than parsing genuine Tcl source files :)
For open source, I find it most suitable that scripts are openly readable, and editable in case of problems.
But TDK does translation to _some_ bytecode which isn't the same bytecode which Tcl interpreter executes (if I understeand correctly TDK compiler idea, of course).
No, it actually uses the same bytecodes. However, TDK has to make the bytecode portable (no BE vs. LE issues allowed), so that is part of the extra translation that doesn't make this loader faster.
I mean to save Tcl bytecode as it's represented just after byte-compilation - when script is loaded into interpreter.
Why write external tools to do such a thing, when Tcl Core (interpreter) already (while script execution) has such a bytecode in memory?
One main reason that this hasn't been an issue is that there isn't a huge overhead to compiling. Other languages have more compile overhead, so it makes more sense there to precompile. Perl for example likes to do a full syntax parse, even over code areas that won't be used. Tcl is much lazier - it only compiles procs as it first executes them. This distributes any compile overhead over the runtime of the application.
--
Jeff Hobbs, The Tcl Guy, http://www.activestate.com/
.
- Follow-Ups:
- Re: Tcl bytecode
- From: Keith Nash
- Re: Tcl bytecode
- References:
- Tcl bytecode
- From: Googie
- Re: Tcl bytecode
- From: suchenwi
- Re: Tcl bytecode
- From: Googie
- Tcl bytecode
- Prev by Date: Re: teapot package: what is?
- Next by Date: Re: teapot package: what is?
- Previous by thread: Re: Tcl bytecode
- Next by thread: Re: Tcl bytecode
- Index(es):
Relevant Pages
|