hi,
so, i've managed to fight myself through the forest of compiling gambit on the castles POS terminal, and using it as an embedded script language managed from a hand written C main function.
http://www.castech.com.tw/en/in-products-03.aspx?id=P_00000109&cid=C_000...
well, almost. the problem is that when i run it on the device, all i get is a random "code 11" error from inside ___setup. it's most probably a sigsegv obfuscated by the lost souls in Taiwan who think that "for the convenience of the programmer" giving years old cygwin exe's of GCC, and translating linux error to their own codes is a help... but that sigsegv is just a wild guess. see my main pasted at the end of the mail.
i was pondering what are the requirements for gambit to run in this setup? is it a problem e.g. that setup_params.gambcdir is not set, nor the files are available?
any other ideas?
my plan is to compile gambit with the terminal API libs, and add some printf debugging inside ___setup, but these tasks are hard enough to ask the more experienced beforehand.
and as a little feedback, here are a few thoughts on what would have helped me: - something as simple as a "git clone foo" for a simple usage as mine, and not being exposed to the complexity of all the bootstrapping related headaches (which are irrelevant for my use-case). this here is way too much details for a simple use-case as mine: http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Contributing_Patches_t...
- an example that compiles on linux, is less complicated than the examples/iOS, and demonstrates how to use gambit from C. especially the magic -D___LIBRARY trick.
- more descriptive names. these names very much don't help understanding what's going on, let alone the single namespace C has: ___setup, ___names_prefixed_with_large_number_of_underscores instead of "gmb_" or something, -D___LIBRARY to stop generating a C main function.
meanwhile i've given up on chibi scheme, purely as a subjective decision, and slightly influenced by its painfully slow speed of loading the libs (which i didn't investigate and may be due to the platform). i'm fighting on 3 fronts (lua, chibi, gambit), so it's not an absolute judgement on chibi, just my subjective least resistance.
given the difficulty in approaching gambit, i would also have given up on gambit if i didn't met Marc on a conference and didn't have such a good impression... :) gambit also seems to be too big for the other smaller POS (http://www.justtide.com/products_detail/&productId=897969ac-a238-4fc8-b2...), the exe is 3.5M, 800k zipped.
compiling and running lua was by far the simplest task with the least number of headaches, even though it's the first time i approached lua. if the language wasn't that weird, lacking data types of my taste, etc... then i'd have already settled down on lua already. but given the headaches i had with compiling scheme's, i'm kinda leaning towards swallowing the lesser language and just implement what actually pays for the bills, as opposed to the intellectual adventure... :)