<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Sun, Mar 4, 2018 at 2:21 PM, Dimitris Vyzovitis <span dir="ltr"><<a href="mailto:vyzo@hackzen.org" target="_blank">vyzo@hackzen.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Sun, Mar 4, 2018 at 1:19 PM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">feeley@iro.umontreal.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
> On Mar 4, 2018, at 3:54 AM, Dimitris Vyzovitis <<a href="mailto:vyzo@hackzen.org" target="_blank">vyzo@hackzen.org</a>> wrote:<br>
><br>
> The first problem is truly insurmountable. Linking more than a handful of modules results in gcc blowing up...<br>
> I haven't managed to compile any non-trivial program that uses a decent part of the gerbil stdlib, they all end with the compiler getting OOM killed.<br>
<br>
</span>I believe this problem would vanish if the tree-shaker is enabled and the runtime library is refactored to avoid gratuitous dependencies.  Then your final executable would only contain the parts of the runtime library (and the program) that are useful for this specific program.<br>
<br>
This strategy is what I envision for the universal backend where the bloat is more severe than in C.<br></blockquote><div><br></div></span><div>The tree-shaker makes a difference indeed. I did manage to compile a program that was OOMing with the tree shaker enabled with (declare (optimize-dead-definitions)).<br></div><div>Unfortunately the resulting program crashes with Bus Error when poked (it starts up fine, but it crashes once it starts communicating) and it's quite hard to tell what went wrong; program works fine with separate linkage obviously.<br></div><span class=""><div></div></span></div></div></div></blockquote><div><br><br></div><div>So the problem was indeed declaration leakage -- there was a (declare (fixnum)) leaking to the rest of the program and crashing inside _num.scm,<br></div><div>just as I predicted :)<br></div><div>I have fixed this by having the compiler issue a reset declaration after each include, followed by the user's prelude declarations if any.<br></div><div>I am also happy to report that the program runs a little faster (~3.2s from ~3.6s), so there is indeed benefit from FPO.<br><br></div>-- vyzo<br></div><br></div></div>