by gkya · 9y ago · 0 comments
https://www.snellman.net/blog/archive/2005-07-06.html
There is also the possibility to compress the image. See :compression option when saving an image:
http://www.sbcl.org/manual/#index-g_t_0040sbext_007bsave_002...
Commercial Lisp implementations like LispWorks and Allegro CL have a treeshaker for delivery, but that's not too surprising, since these products are for developers of applications and the users pay for such features.
in this case
(funcall #'+ 1 2 3)
or the more scheme-ish (apply '+ '(1 2 3))
i think the symbol plus gets evaluated to #<function+> and then is called with 1 2 3 - CL will do apply, of course, not sure about scheme and funcall. I'm totally willing to accept my mental model is wrong, i don't have an interpreter handy.So if that's true, you run into this problem:
(funcall (string->symbol "+") 1 2 3)
(apply (string->symbol "+") '(1 2 3))
maybe string->symbol does not introduce in to the function namespace, but i bet there's a way or a flag to do it.so anyway, at the end, you run into this problem:
(funcall (string->symbol "any-random-function") 1 2 3)
(apply (string->symbol "any-random-function") '(1 2 3))
this makes tree shaking hard.you could, of course, look for the handful of ways to bind symbols to functions, maybe do constant folding and include a minimal set if the compiler can prove what's actually needed.
but in general i think tree shaking is hard when you can load things like that dynamically.