<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear Marc,</div><div><br></div><div>An interesting question came up when discussing treeshaked Gerbil static builds:</div><div><br></div><div>One could get a C-compiled program</div><div><br></div><div> * that is optimally and maximally tree-shaked hence omitting inclusion in the binary of evidently unused code, and</div><div><br></div><div> * with optimal performance in the respect of having no trampoline calls at all,</div><div><br></div><div>if one would just append together Gambit's runtime's .scm files with one's program's .scm files, into one gigantic total.scm file, which has (declare (optimize-dead-definitions)) and is built with --enable-single-host .</div><div><br>To take this conversation one step further, I like to ask, is this practically possible?</div><div><br></div><div>I'd really guess it is. If so, your hints about how I can actually do this would be much appreciated.</div><div><br></div><div><br></div><div>My program consists of the three vanilla Gambit .scm files a.scm b.scm c.scm .</div><div><br></div><div>I guess very roughly this will be a tweak of</div><div><br></div><div>echo "(declare (optimize-dead-definitions))"  > total.scm</div><div>cat gambit/lib/*.scm a.scm b.scm c.scm >> total.scm</div><div>gsc -e '(compile-file-to-target "total.scm")' (aka gsc -c total.scm)</div><div>cat gambit/lib/os_*.c total.c > c_total.c</div><div>gcc -o mystaticexe -Igambit/include/ c_total.c</div><div><br></div><div>Here especially, any more C files than gambit/lib/os_*.c needed, and should the Gambit runtime .c and .scm files be appended in a particular order if so which?</div><div><br></div><div>Thanks!<br>Adam</div></div></div></div>