[Gambas-user] Passing programs

Rob Kudla sourceforge-raindog2 at ...94...
Wed Mar 29 18:17:37 CEST 2006


On Wed March 29 2006 10:53, Adrian Debbeler wrote:
> one aspect which bars me from deciding for Gambas is that it
> seems to be really difficult to pass my programs to others. Is
> there any alternative to pass gambas programs more easily (so
> the receiver has not to install the whole gambas program?). Of
> course it would be the best if the interpreter would be
> compiled with my own program which has the advantage that the
> user does not have to bother about the interpreter etc.

The ability to create stand-alone programs is probably the single 
most requested Gambas feature.  In theory, here is what is 
required to make this happen:

1. The Gambas intepreter needs to be converted into a library.  
The current executable "gbx2" would become a stub which does 
nothing but load that library and use it to execute a project.

2. Gambas executables need to be converted into stubs as well, 
just like gbx2.  This will have no effect on distributability 
but will allow people to run Gambas programs from Konqueror, for 
example, or use them as script interpreters, because they will 
no longer be weird hybrid script/binaries.

3. The interpreter library and all the components need to be made 
statically linkable, which would allow the creation of a huge 
monolithic executable like people are always asking for.  At 
this point, you would be able to send your Gambas program to 
someone with the same version of the libraries used on your 
development system, and they'd be able to run them.  I have no 
idea what would be involved in doing this, because I've never 
been successful in trying to convert shared objects into 
statically linked modules.

4. Because the resulting executable will be enormous, use UPX or 
some other executable compressor to make it smaller, as used by 
MAME and many other packages.

Doing all of the above would enable what you and others are 
asking for, but I don't think it will be an easy task.  Even 
when it's done, a Gambas program won't run across any Linux 
system you put it on.... if they're running a too-old or too-new 
version of Qt, for example (or Gtk when the gb.gtk component is 
totally equivalent), it will barf.

An alternative to this approach would be the one used by Freewrap 
to package Tcl/Tk programs.... create a single compressed 
self-extracting executable with all the components in them, 
extract them at runtime to /tmp, and run from that directory.  
That would be comparably easy, but you'd still run into 
potential library version problems.

Naturally, Gambas programs compiled using these methods will also 
not work under Windows, at such time as a usable Windows version 
of Gambas exists, or on other platforms that support Gambas.

So, it should be possible, but it won't be here for a while.  In 
the meantime, I encourage people to look into "klik", a 
single-file software distribution method that requires only a 
small client to be installed on the target machines.  No one has 
been able to package Gambas for klik yet, but there's no reason 
it should be impossible.

Rob




More information about the User mailing list