<div dir="ltr">Well the code size shrank considerably and the code still ran as expected, thats all I recall.  Keep in mind though that some of the optimisations done by closure are whitespace removal / string substitutions etc which are decidedly less complicated than global analysis and dead code removal.  I really couldn't tell you which level (simple / advanced) of optimisations that I tried.  I was simply curious to see if it would help reduce the payload size is all.<div><br></div><div>Cheers,</div><div><br></div><div>James</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 18, 2017 at 9:23 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">I’m with Adam on this subject.  It would take some very fancy analysis for the Google Closure compiler to remove the code that Gambit’s tree shaker removes. Gambit can do it because it has knowledge about the structure and semantics of the generated code.<br>
<br>
So when you say “it worked fine” I assume you mean the output code runs fine, not that Google Closure did a good job at removing dead code.  Some benchmarking would be useful here!<br>
<br>
Marc<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
> On Sep 18, 2017, at 5:06 AM, James Baker <<a href="mailto:james@waveformdynamics.com.au">james@waveformdynamics.com.au</a><wbr>> wrote:<br>
><br>
> I've tried Google Closure compiler previously on Gambit generated JS and it worked fine, it was a while ago and admittedly my scheme code wasn't doing anything overly complicated but still.<br>
><br>
> Cheers,<br>
><br>
> James<br>
><br>
> On Mon, Sep 18, 2017 at 5:10 PM, Adam <<a href="mailto:adam.mlmb@gmail.com">adam.mlmb@gmail.com</a>> wrote:<br>
> Sonny,<br>
><br>
> Gambit has its own register of global variables, which it keeps in some JS object. An external JS code tree shaker would not be able to distinguish what can be removed and what cannot as they - as far as I am aware - not introspect JS structures, but instead just look for unused identifiers/functions and remove those. And also it would not be able to remove what's not used.<br>
><br>
> So the whole way input code maps to JS code is beyond what JS code shaker's abilities.<br>
><br>
> However maybe my understanding of your JS tree shaker is not correct and it's so incredibly smart that it can cut through also such intricate code.<br>
><br>
> What about you give it a try and let us know here?<br>
><br>
> Adam<br>
><br>
><br>
> 2017-09-18 0:36 GMT+08:00 Sonny To <<a href="mailto:son.c.to@gmail.com">son.c.to@gmail.com</a>>:<br>
> Have you considered running the output through google closure compiler for the tree shaking? thats what clojurescript does<br>
><br>
> On Sun, Sep 17, 2017 at 6:21 AM Adam <<a href="mailto:adam.mlmb@gmail.com">adam.mlmb@gmail.com</a>> wrote:<br>
> 2017-08-17 10:13 GMT+08:00 mikel evins <<a href="mailto:mevins@me.com">mevins@me.com</a>>:<br>
><br>
>> On Aug 16, 2017, at 9:11 PM, Marc Feeley <<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>> wrote:<br>
>><br>
>> The JavaScript backend is being worked on actively this summer.  It is in much better shape than 6 months ago.  Currently we are working on implementing a tree shaker to reduce the size of generated code.<br>
><br>
> Nice!<br>
><br>
> Thanks,<br>
><br>
> --me<br>
><br>
> What's new with respect to the Javascript output now?<br>
> ______________________________<wbr>_________________<br>
> Gambit-list mailing list<br>
> <a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
> <a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" rel="noreferrer" target="_blank">https://webmail.iro.umontreal.<wbr>ca/mailman/listinfo/gambit-<wbr>list</a><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> Gambit-list mailing list<br>
> <a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
> <a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" rel="noreferrer" target="_blank">https://webmail.iro.umontreal.<wbr>ca/mailman/listinfo/gambit-<wbr>list</a><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> Gambit-list mailing list<br>
> <a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
> <a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" rel="noreferrer" target="_blank">https://webmail.iro.umontreal.<wbr>ca/mailman/listinfo/gambit-<wbr>list</a><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">Marc<br>
<br>
<br>
<br>
</font></span></blockquote></div><br></div>