slang-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] slc2c - made an includer, want feedback


Well, it doesn't 'have' to be 1 file, but a simple system to distribute a 's-lang capable' app would be sweet. This is a major issue for me, and one reason I don't use perl, python or even ruby as much. Too much baggage to tell someone to install. And forget it in my embedded systems, although todays 32mb+ 'embedded' systems can support ruby fine.

Tk is fat, along with ncurses.

I really must make time to get my quicken clone done in s-lang, so I can port my data and dump windows forever(well ok, I do need it for esoteric win-ce and rex6000 dev kits...)

Regards,
Joe Robertson


Michael Noble wrote:
I am curious of what you think of my idea. I have created (converted) an
optional utility that is used with Lua which takes a compiled SLang
file, reads it in binary mode, creates a function sorta like:

void hello() {
 const unsigned char B1[] = { 12, 20, 10, ... ... };
 SLang_load_string(B1);
}

Now, in your C application where you want to provide both C intrinsics
and also some code written in S-Lang, you can do something like:

#include "hello.c"

void main() {
 SLang_init_all();
 hello();
 SLang_load_file("whatsup.sl");
}


This approach can be useful for creating "standalone" applications built
from collections of scripts.  There is a "mktclapp" utility, at

	http://www.hwaci.com/sw/mktclapp/

which does a similar thing, plus a bit more, for the Tcl language.  It
supports embedding scripts as static/constant C strings (which are passed
to an eval() mechanism at runtime), as well the inclusion of binary data
files, although I don't know if it will embed compiled Tcl byte codes.

By way of example, the very popular astronomical imaging tool, DS9
(written at the Smithsonian Astrophysical Observatory), uses mktclapp
to compile its Tcl scripts into C/C++ code, in order to create a
binary distribution containing only 1 file: a statically linked ds9
executable, with zero external dependencies.

This makes installing ds9 _very_ simple: just drop a copy onto your
disk and it's ready to go ...  no gnu-configuring, no building, no
installing scripts into system directories, no library version
mismatches, etc, and Tcl/Tk is not even required to be installed
on the system.

Regards,

-Mike

_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html



_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]