Re: creating stand-alone extended tclsh
- From: Eric Hassold <hassold@xxxxxxxxxxx>
- Date: Sun, 29 Apr 2007 16:37:52 +0200
Hi,
Gerald W. Lester wrote:
Alexandre Ferrieux wrote:On Apr 29, 12:06 pm, David Gravereaux <davyg...@xxxxxxxxx> wrote:4) relish your in your large executable, though I prefer those grilled red onions
and mustard to top my dogs.
I'm a bit surprised by this aversion of static linking. Though
obviously it's a waste of system resources for libc or libX11, for
most of the rest of libs, it changes absolutely nothing because the
executable is the only one in the system that will *ever* use it
(specific libraries : only for specific needs). While static linking
has several pointwise advantages I have come across:
- debugging in old versions of gdb
- no risk of half-install
- no risk of version mismatch
- single-file installerless executable (like a *kit but with no
startup overhead due to extracting DLLs to temporary files).
The aversion comes from experience.
The experience of constant rebuilds when a new version of an extension (available pre-built in a binary) we use comes out or when we need another extension.
Feel free to do as you like, experience tells most of us that is not the way to go.
Tcl is a very flexible language, and people have very different experiences with it, under very different contexts. I don't know what "most of us" believe, but I know my own experience makes me believe both static and dynamic approaches have their "pros" and "cons", and I favour either according to curcumstances.
You're right, more Tclers enjoy flexibility offered by dynamically loading extensions, and this is probably good (if not best) way to go when running on a single machine (or homogeneous environment). But when it comes to software deployment to multiple, heterogeneous systems, statically linked binaries offer very significant advantages.
When you have been faced once to a customer/user reporting a problem you can't reproduce, and you finally find, after a long and hard investigation since you don't have access to his machine, that this is due to some unstable (or just different) shared library which has leaked in his system, experience tells you static linking has its "pros" :-)
BTW, version mismatch between executables is almost non-existent due to TEA. You are much more likely to hit a problem, over time, that some of the scripts you are using want version X and some want version Y of a packages. With static linking this is a problem, with dynamic loading Tcl will load the correct version in for you automatically (both can exist on the disk at the same time due again to TEA).
I fully agree, but this can actually also be considered a "cons" under some circumnstances.
From a quality assurance and release management point of view, you can't be assured that executable tested on the developer’s machine will run unadulterated on the target machine. Even worst, your runtime may work fine for monthes or years before getting suddenly broken by some unrelated install which will put some interfering DLL on your system, or because sysadmins has decided to upgrade some parts of the O.S. on the production environment.
On the opposite, static linking offers:
- a simple solution to tag executables, manage versionning and Q-A certification
- deployment is trivial (I especially enjoy this when "installing" on embedded systems like set-top boxes or routers: copy a single file in flash, run, that's all!)
- rollbacks are made easy
- if different services require different configurations, they can coexist on system without interfering
Last, static executable doesn't mean "load" has to be disabled, so with some care, Tcl can offer best of the 2 worlds. For example, since eTcl is distributed as a static executable, all embedded (and officially supported) extensions should behave the same no matter which distribution you are running, and which version of libpng, libopenssl, libsqlite, etc... you have (or haven't) installed on your system. But it's still possible to load TEA compliant extensions the standard way, to extend and customize it the way you want.
To conclude, *my* experience tells me I love Tcl for supporting easily both static and dynamic approaaches, and letting me decide on a daily basis which one better fits my needs for a given project or context.
Eric
-----
Eric Hassold
Evolane - http://www.evolane.com/
.
- References:
- creating stand-alone extended tclsh
- From: Will Parsons
- Re: creating stand-alone extended tclsh
- From: David Gravereaux
- Re: creating stand-alone extended tclsh
- From: Alexandre Ferrieux
- Re: creating stand-alone extended tclsh
- From: Gerald W. Lester
- creating stand-alone extended tclsh
- Prev by Date: Re: creating stand-alone extended tclsh
- Next by Date: Re: n00b saying "hi"
- Previous by thread: Re: creating stand-alone extended tclsh
- Next by thread: Re: creating stand-alone extended tclsh
- Index(es):
Relevant Pages
|