Hi Marc,
I was frustrated trying to run emscripten powered gambit-c program on web browser.
The attachment gsi.scm is my program, there's an explicitly main function delcare here to make sure the js code was completely loaded before calling gambit-c _setup() function. I put ##repl-debug-main in primordial thread and call _setup() in main to bring up the whole gambit-c system. I use the attachment my-build-script to generate the ultimate gsi.js file. I issue echo "(load "fib") (pp (time (fib 20)))" | /usr/bin/time node gsi.js, and everything is fine. Unfortunately gsi.js was stuck in a web browser environment.
Through some experiment, I found the _setup() function never return, the comment in the code said it will create a service thread which executes the rest of the program. I think it is the reason why it hung the web browser. I also did another experiment, explicitly make the primordial thread exit. said issue echo "(load "fib") (pp (time (fib 20))) ,q" | /usr/bin/time node gsi.js, but the web_trampoline function throw an exception, I trace the exception was threw from macro-run-queue of ##next-heartbeat-interval function
The reason I don't want to use recent gambit to build with emscripten is I am afraid the ultimate js file would be tremendious large. Looking forward your reply and help