I would really like to see a runtimeless version of Tcl come out of
Sun. It would be great if one of the configure options allowed you
to build a interpreter without the need of having to carry around
all the runtime files contained in the TCL_LIBRARY and TK_LIBRARY
directories. Maybe we are unique in that we develop at our desks
and need to then move our scripts and interpreter into a lab
environment. I can't count the number of problems we've had when
people move only the interpreter and copy the runtime files to the
wrong location or over the top of those for a previous version.
Throw in all the additional headaches of legacy code using older
versions of Tcl using different runtimes and you should get the
point. The environment variable solution doesn't work either. They
only make things worse. Having a completly self-contained
interpreter would solve the problem.
Is it really necessary that that Tcl have a runtime anyway ? Sure
it proves that you can have the interpreter execute internal
commands that are written in either tcl or C, but it seems that is
all it does: prove the point. Does anyone else have this same need
or see the same problem exhibited in their usage of Tcl ?
In an attempt to at least make our scripts more self-contained, we
use a derivative of tcl2c to wrap up all of our scripts and create a
single executable containing both the interpreter and scripts. This
works, but we still need to have all the Tcl runtime files in place.
We tried to wrap up the runtime files with tcl2c, but the tcl core
checks for the existance of the init files and such during
initialization. Has anyone else found a more elegant solution ?
--
____________________________________________________________________________
_/_/ _/_/ _/ _/ _/ Mark L. Ulferts
_/ _/ _/ _/ _/ _/ _/ ulf...@inetport.com (home)
_/ _/_/ _/ _/ _/ _/ mulf...@austin.dsccc.com (work)
_/ _/ _/ _/ _/_/_/ _/ _/_/_/_/ _/ DSC Communications Corp, Austin Texas
____________________________________________________________________________
> More information about these patches:
> http://www.cogsci.kun.nl/~nijtmans/tcl/patch.html
>
Oops, wrong reference. That should be:
http://www.cogsci.kun.nl/tkpvm/pluspatch.html
Sorry
Jan Nijtmans
NICI (Nijmegen Institute of Cognition and Information)
email: nijt...@nici.kun.nl
url: http://www.cogsci.kun.nl/~nijtmans/
This was exactly one of the ideas that is implemented in the
"plus"-patches. In order to make programs that are fully standalone
indeed a small modification to the core is needed. The "plus"-
patches to that, and also deliver a simple tcl2c utility that can
do the wrapping for you own scripts. For example:
- In tcl7.5p1+, "make standalone" produces a new file
"tclsh.standalone", which behaves exactly like tclsh only it
doesn't need the runtime directories any more
- In tk4.1p1+ the same is true for wish (wish.standalone).
- The tcl2c utility is able to produce standalone executables
containing your own scripts, using the modified libraries
libtk4.1.a and libtcl7.5.a. For example (for Solaris):
tcl2c example.tcl -o example.c -tk
cc -o example example.c /usr/local/lib/libtk4.1.a \
/usr/local/lib/libtcl7.5.a -ldl -lnsl -lsocket -lm
Then you have an single executable containing everyting.
More information about these patches:
http://www.cogsci.kun.nl/~nijtmans/tcl/patch.html
You could also use ET (Embedded Tk) which has much more functionality,
but therefore also is more complicated.