[Starkit] Linkable starkit library?

Jeff Hobbs jeffh at activestate.com
Fri May 26 12:58:15 CEST 2006


Jean-Claude Wippler wrote:
> Jeff Hobbs wrote:
> > Clif Flynt wrote:
> >>   I've got some Tcl code that I'd like to make available to folks 
> >> developing in C and FORTRAN.
> >>
> >>   Embedding Tcl is easy enough if you've got a full Tcl library at 
> >> the user end, but I'd like to provide them with a single library to 
> >> link against which would generate a single executable for their 
> >> application.
> >
> > As suspected, you want a stardll.
> 
> Not sure.  A stardll is a dll with a vfs at the end.  I think Clif  
> wants a static library which gets linked into an app with no extra  
> concern about VFS stuff (just like the Tcl static lib works for such  
> purposes).

You are right in that the stardll is not a fully static solution, but it
wasn't clear that is what Clif wanted.  The stardll approach (with only a
single extra dynamic library) has many advantages in fact.  Take for example
the approach that we have built for Perl's Tcl.pm module.  In the most recent
version, we put in the necessary includes and stub lib files so you can build
the module without a Tcl installation on 99.5% of platforms.  It only added a
few KB to the source dist.

For runtime operation, it can use *any* 8.4+ Tcl installation, including
stardlls.  We use this solution at ActiveState for the Perl Dev Kit UIs.  You
can do a full update on the Tcl/Tk part without bothering anything else, and
this was important as we made many fixes to tile and other modules during
initial development.

> One of the things I'm working on is a more adjustable way of opening  
> MK datasets inside a file.  Then, VFS could be embedded in C (or in  
> an ELF loader section), and you'd be able to mount it just by passing  
> a pointer.  As it is, we're not quite there yet.
> 
> For now, you could use either use a stardll (i.e. a second file), or  
> give them a VFS (i.e. a starkit) which they need to append at the end  
> of their exe befure using it.

This would also be useful for a certain class of applications, but I would
still argue that stardlls are a better approach for $language<->Tcl bindings.

Jeff



More information about the Starkit mailing list