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
What do you consider "huge"?
-- Scott
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:
> > >
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>
> 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
--------------------------------------------------------------
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
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
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...
> 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
--
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
> 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
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.
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