Re: Tcl bytecode
- From: "iu2" <israelu@xxxxxxxxxxx>
- Date: 31 Jan 2007 03:23:41 -0800
On Jan 30, 7:02 pm, Keith Nash <k...@xxxxxxxxxxxxxxxx> wrote:
Jeff Hobbs wrote:
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.
<snip>
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.
Some large Tcl apps are slow to start: is this because too many procs are
executed in the startup script?
Python seems to have a good compromise: when it is installed for the first
time, all the libraries are compiled and saved locally as *.pyc files
alongside the *.py originals. This way there are no portability issues.
Also, tampering with the *.pyc file is presumably no more difficult than
tampering with the original *.py.
Keith.
Python also compiles all the modules imported to an application upon
first time running the application. This is done in order to shorten
startup time the next time the application is started. Funny, but I
don't notice a difference between compiled Python and tcl scripts
startup times. Python's IDLE takes more time to start than tkcon, but
tkcon is a smaller application so it might not be a good comparison. I
also think that tcl's code parsing is way faster then Python's, due to
tcl's simple syntax: "command params", so bytcode files are not really
necessary.
I once also wondered why not have bytecode files in tcl, but now I
think that after all I don't miss them. 1) tcl scripts startup time is
not so long (at least compared to Python) and 2) I prefer my script
directory not filled up with other files (generated bytecode) than my
own source files.
iu2
.
- Follow-Ups:
- Re: Tcl bytecode
- From: Googie
- Re: Tcl bytecode
- References:
- Tcl bytecode
- From: Googie
- Re: Tcl bytecode
- From: suchenwi
- Re: Tcl bytecode
- From: Googie
- Re: Tcl bytecode
- From: Jeff Hobbs
- Re: Tcl bytecode
- From: Keith Nash
- Tcl bytecode
- Prev by Date: Re: TWAPI and NET SESSION
- Next by Date: Re: Tcl bytecode
- Previous by thread: Re: Tcl bytecode
- Next by thread: Re: Tcl bytecode
- Index(es):
Relevant Pages
|