Skip to content

Comment on Tiny Treeshaker: JavaScript tree shaking in 200 lines of codeparent

Comments

As I understood it, jdeps is only for shrinking the runtime and bundling it with the program. This part seems fine.. or at least they're doing the best they can :)

I ended up skipping this step and distributing a JAR - which is a bit of no-no .. but i just ask user to install the Java runtime. (it's better than making executable for every platform and then spinning up VMs to test)

However, jdeps or not, the rest of the executable still remains as bloated as before

You are right in that it doesn’t do dead code elimination per se.

But if my understanding is correct, java classes are loaded as needed. So other than JAR size, you don’t really need it as much as in the case of JS for example.

That's an important distinction. I guess my annoyance is mostly cosmetic. The app is pretty small and does a simple data processing task. Had I written the app in C++ it would have been a couple of megabytes (and it would have taken me 10 times longer to write..). But with Clojure/Java/JVM/jdeps it comes out as some monstrous 100MB installer. It just feels a bit gross ...

End user apps are second class citizens on the JVM (except weirdly on Android.. but they're in a weird bubble of their own)

Perhaps give native compilation a try? Not sure how well does it work with Clojure, but that might shrink the app size a bit as well?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.