Tcl Executables

1 view
Skip to first unread message

Scott Redman

unread,
Apr 14, 1999, 3:00:00 AM4/14/99
to
Try TclPro's prowrap. I'm not sure what the difference in size will be
(what's your definition of huge?). You can download TclPro eval and try
it out.

http://www.scriptics.com/tclpro/

-- Scott Redman


Someone wrote:
>
> Hi
>
> Can any1 tell me if there is a way to create executables from TCL/TK code,
> and where to get a program which will do that. I`ve tried freewrap, but the
> exe files are huge!
>
> Thanx

Scott Redman

unread,
Apr 14, 1999, 3:00:00 AM4/14/99
to
TclPro includes a demo, klondike, and when it's wrapped the size is
about 2.2MB. If you run klondike.exe through zip, it shrinks
to 1.3MB. (this is for WinNT/95, if you want Solaris or another
system, let me know and I'll check)

What do you consider "huge"?

-- Scott

Someone

unread,
Apr 15, 1999, 3:00:00 AM4/15/99
to

Someone

unread,
Apr 15, 1999, 3:00:00 AM4/15/99
to
hi

i was looking for some freeware or shareware which would do the job

definition of huge? well, a script with about 100 lines of code, and
executable about 1.5 megs is huge. i`d rather it be a few k, not a few megs


Scott Redman <red...@scriptics.com> wrote in message
news:3715462F...@scriptics.com...


> TclPro includes a demo, klondike, and when it's wrapped the size is
> about 2.2MB. If you run klondike.exe through zip, it shrinks
> to 1.3MB. (this is for WinNT/95, if you want Solaris or another
> system, let me know and I'll check)
>
> What do you consider "huge"?
>
> -- Scott
>
> Scott Redman wrote:
> >
> > Try TclPro's prowrap. I'm not sure what the difference in size will be
> > (what's your definition of huge?). You can download TclPro eval and try
> > it out.
> >
> > http://www.scriptics.com/tclpro/
> >
> > -- Scott Redman
> >
> > Someone wrote:
> > >

Donal K. Fellows

unread,
Apr 15, 1999, 3:00:00 AM4/15/99
to

In article <924177877.5972.0...@news.demon.co.uk>,

Someone (probably <root @ ullapool . demon . co . uk>) wrote:
> i was looking for some freeware or shareware which would do the job

Well, that means freewrap. And if you don't like what it produces...

> definition of huge? well, a script with about 100 lines of code,
> and executable about 1.5 megs is huge. i`d rather it be a few k,
> not a few megs

Tough. A few megs is the size of the Tcl and Tk libs, and when you
produce a wrapped program those libs have to be built in. Code does
not suddenly appear by magic out of thin air, you know...

Donal.
--
Donal K. Fellows http://www.cs.man.ac.uk/~fellowsd/ fell...@cs.man.ac.uk
-- The small advantage of not having California being part of my country would
be overweighed by having California as a heavily-armed rabid weasel on our
borders. -- David Parsons <o r c @ p e l l . p o r t l a n d . o r . u s>

Chang LI

unread,
Apr 15, 1999, 3:00:00 AM4/15/99
to
Donal K. Fellows wrote:
>

> Tough. A few megs is the size of the Tcl and Tk libs, and when you
> produce a wrapped program those libs have to be built in. Code does
> not suddenly appear by magic out of thin air, you know...
>

For two line script and 100 hundred line script they have the roughly
same executable size. I think there is something need to be improved.

--
--------------------------------------------------------------
Chang LI, Neatware
email: cha...@neatware.com
--------------------------------------------------------------

Scott Redman

unread,
Apr 15, 1999, 3:00:00 AM4/15/99
to
If the wrappers were smart enough to predict which of the
many .tcl-based library files you need, sure. But Tcl and
Tk are themselves very large, so what you're seeing for
a 2-line script and a 100-line script is the size of the
core Tcl and Tk, not the script...

The only way to reduce this size is to reduce the size of
Tcl and Tk (or don't use Tk). Even the TkGS project won't
help this out (in fact, it may actually increase the sizes).
Maybe an effort to break Tcl/Tk into many smaller pieces with
a simplified kernel could help, but you'd have to tell
the wrapper which pieces you use. Otherwise, the added code
to deal with the split-up will increase the size from what
it is now, nice paradox huh?


-- Scott

DUPERVAL, LAURENT

unread,
Apr 15, 1999, 3:00:00 AM4/15/99
to
Chang LI wrote:
>
>
> For two line script and 100 hundred line script they have the roughly
> same executable size. I think there is something need to be improved.
>

How? As Donal says, in order to get a working executable you have to
statically link the Tcl lib and the Tk lib. If you're using binary
extensions, you have to link in those also. You may want to analyze the
script and remove portions of the lib modules if they aren't needed in
the script. But what if the script you are wrapping sources another file
which requires whatever part of the library was removed?

I other words, dynamic linking has a great number of advantages that
shouldn't be overlooked, just because you want to "hide your code". But
if you absolutely want (need?) to have a monolithic application, you
have to live with the drawbacks.

L

--
Penguin Power!

Laurent Duperval - CGI
5 Place Ville Marie, Suite 1600 South, Montreal H3B 2G2
Tel: (514) 870-0879 Fax: (514) 391-2212
EMAIL: mailto:laurent....@cgi.ca

Someone

unread,
Apr 15, 1999, 3:00:00 AM4/15/99
to
Hi me again

I heard u could convert tcl to c code - if u could do this, then create an
exe file from the c code, how big would it be then for a program, say 100
lines of code? Also, where can i get a program which would convert tcl ->
C, and would it be possible to compile it with something like Bordland C++ ?

Someone <n...@telling.you> wrote in message
news:924138467.20134.0...@news.demon.co.uk...

Chang LI

unread,
Apr 15, 1999, 3:00:00 AM4/15/99
to
DUPERVAL, LAURENT wrote:
>
It does not mean you can do this with dynamic linking.
But the static linking is possible. So just compile
your script together with the Tcl/Tk C code it is
possible to delete unused C functions. For example,
if you did not use the canvas in your script, you can
get this widget out at all. This will decrease the
executable code. At present Tcl/Tk's architecture
did not adapt in this model. This will require the
rewrite of the kernel.

> How? As Donal says, in order to get a working executable you have to
> statically link the Tcl lib and the Tk lib. If you're using binary
> extensions, you have to link in those also. You may want to analyze the
> script and remove portions of the lib modules if they aren't needed in
> the script. But what if the script you are wrapping sources another file
> which requires whatever part of the library was removed?
>
> I other words, dynamic linking has a great number of advantages that
> shouldn't be overlooked, just because you want to "hide your code". But
> if you absolutely want (need?) to have a monolithic application, you
> have to live with the drawbacks.
>
> L
>
> --
> Penguin Power!
>
> Laurent Duperval - CGI
> 5 Place Ville Marie, Suite 1600 South, Montreal H3B 2G2
> Tel: (514) 870-0879 Fax: (514) 391-2212
> EMAIL: mailto:laurent....@cgi.ca

--

Alexandre Ferrieux

unread,
Apr 16, 1999, 3:00:00 AM4/16/99
to
Scott Redman wrote:
>
> If the wrappers were smart enough to predict which of the
> many .tcl-based library files you need, sure.

This sparks an interesting possibility: in the (possibly distant)
future, when we have the core properly modularized at the object file
level (I'm not saying at the .so/.dll level, only .o/.obj), what about
including some kind of dependency analysis tool in ProWrap (and possibly
in the open source distrib too :) ?

There could be at least two parts:

- a static one, that would simply scan the source for called procedure
names (okay, this one will miss the dynamically built and evalled
strings...)

- a dynamic one, that would sit in the background while you play with
your app, and record what modules (in the above sense) you really use.

Both would be followed by a transitive closure, and would output a
consistent (no unresolved procs/packages), *minimal* set of module
names. Then you (or ProWrap) would link them into a custom tclsh/wish
that shouldn't be blamed for useless fat...

Reactions ?

-Alex

Bill Schongar

unread,
Apr 16, 1999, 3:00:00 AM4/16/99
to
Alexandre Ferrieux wrote:

> This sparks an interesting possibility:

> ... what about including some kind of dependency analysis tool

> in ProWrap (and possibly in the open source distrib too :) ?

...


> - a dynamic one, that would sit in the background while you play with
> your app, and record what modules (in the above sense) you really use.

...
> Reactions ?

That would be a feature I'd certainly pay for...

Right now, without Tk, I can get a ~550K binary using the Plus Patches
as distributed, and have had some success making it smaller (by
rebuilding the Tcl static lib and dropping things..)

That's not too bad when distributing via disk or network, but smaller
would be much better for folks retrieving it via modem.

Heck, even a simpler automated process to allow you to build static
libs with specific subsets - maybe it's just me, but for small log
parsers and data formatting tools I don't use a large number
of Tcl functions.. most of them would probably fit in a 100K (or smaller)
static lib. (I'll have to check to make sure...)

-Bill


DUPERVAL, LAURENT

unread,
Apr 16, 1999, 3:00:00 AM4/16/99
to
Chang LI wrote:
>
> It does not mean you can do this with dynamic linking.
> But the static linking is possible. So just compile
> your script together with the Tcl/Tk C code it is
> possible to delete unused C functions. For example,
> if you did not use the canvas in your script, you can
> get this widget out at all. This will decrease the
> executable code. At present Tcl/Tk's architecture
> did not adapt in this model. This will require the
> rewrite of the kernel.
>

Maybe, but let me reiterate my position: if your program sources an
initialization file which contains Tcl code in it, you automatically run
the risk of having one of your users put in arbitrary commands for which
you have stripped the Tk functionality, for example. I admit that the
casual user won't do that, but, for example, I don't consider myself as
the average user. Maybe I'm just splitting hairs.

alex...@my-dejanews.com

unread,
Apr 19, 1999, 3:00:00 AM4/19/99
to
There is a utility called "tcl2c" that will do this for you. However, I have
done it both ways and I don't believe you will see the dramatic decrease in
executable size you are looking for. What your talking about is basically
taking the long route to get to the same place. :)

Daniel Alexander

In article <924203925.3723.0...@news.demon.co.uk>,

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Reply all
Reply to author
Forward
0 new messages