<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">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 class=""><br>
> On Mar 4, 2018, at 3:54 AM, Dimitris Vyzovitis <<a href="mailto:vyzo@hackzen.org">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><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><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""></span><br>
I think a new form to limit the scope of declarations would be useful for all of this.  For example:<br>
<br>
   (declare (core))<br>
<br>
   (begin-with-declaration-scope<br>
    (declare (not core))<br>
    (include "mod.scm"))<br>
<br>
   ;; at this point we are back in the scope of the (declare (core))<br>
<br>
Maybe begin-with-declaration-scope could have a better name…<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>Such a form would make life much simpler indeed, no need to reset declarations after including.<br><br></div><div>-- vyzo<br></div></div></div></div>