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
decidedly less complicated than global analysis and dead code removal. I
that I tried. I was simply curious to see if it would help reduce the
payload size is all.
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.
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!
Marc
Post by James BakerI'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.
Post by James BakerCheers,
James
Sonny,
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.
Post by James BakerSo the whole way input code maps to JS code is beyond what JS code
shaker's abilities.
Post by James BakerHowever 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.
Post by James BakerWhat about you give it a try and let us know here?
Adam
Have you considered running the output through google closure compiler
for the tree shaking? thats what clojurescript does
Post by James BakerPost by Marc FeeleyThe 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.
Post by James BakerNice!
Thanks,
--me
What's new with respect to the Javascript output now?
_______________________________________________
Gambit-list mailing list
https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
_______________________________________________
Gambit-list mailing list
https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
_______________________________________________
Gambit-list mailing list
https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Marc