> On Mar 4, 2018, at 3:54 AM, Dimitris Vyzovitis <vyzo@hackzen.org> wrote:
>
> The first problem is truly insurmountable. Linking more than a handful of modules results in gcc blowing up...
> 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.
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.
This strategy is what I envision for the universal backend where the bloat is more severe than in C.
I think a new form to limit the scope of declarations would be useful for all of this. For example:
(declare (core))
(begin-with-declaration-scope
(declare (not core))
(include "mod.scm"))
;; at this point we are back in the scope of the (declare (core))
Maybe begin-with-declaration-scope could have a better name…