📝 In my last article, I want to reevaluate my thoughts and see whether the existence of GraalVM means Java is now suitable for CLI programs or not. During the article, we compare two implementations of a Money converter CLI tool in Java and Go to see the difference. 🔗 Article link: https://lnkd.in/dAxxqWhP
Thanks for sharing, Saeed Do you have any opinion on, why Java GraalVM is more efficient than golang?
I generally agree with your conclusion, read your article in one breath cause experimented with graalvm just recently, but compared frameworks AOT support , not CLI set-ups. And got very comparable numbers in terms of binary size and compilation latency. I reckon Go still shines in infra level projects where quick start is combined with fibers, but it was very disclosive to see that Java beats Go in CLI set-up.
you mentioned the build time in your article, why not in this image? it would be a more fair comparison and more transparent.
Amazing❤️
Shhhh. I'm sure thr java haters will dell you even though its faster then go it varies too much :)
Recently created a Native Spring Shell CLI for our team as well. It works like a gem. The main requirement was the ability to just run it on any machine without having any development tools installed for non-developers. It was quite fun to build and it gets the job done! Because it is a Spring Shell it came with the whole history, previous commands, auto-completion and documentation out of the box. Like making a normal cloud native app, just CLI format 😊 . But yes, as with every native app, testing is still done in non-native mode, so it is just important to add any reflection model object to the Native auto-bind 🫥 as an annotation.
Love this, Saeed
SWE | Open-Sourcer | Java & Kotlin Expert | JVM Tuning & Optimization | Scalable & High-Performance Systems | Spring Boot, Netty, GraalVM | Node.js, TypeScript, Vue.js
3moJust keep in mind that, while I’m a big fan of GraalVM, I don’t think it’s really “production ready” yet. Apps that rely on things like Java Agents or the Reflection API often run into issues. Also, native image build times are so slow that you won’t compile on every run, meaning you might only find out something’s broken late in the dev cycle, wasting a lot of time. That said, when you can use GraalVM, it’s great especially for short-lived apps where you avoid JVM startup time.