I wrote about how to write command-line tools in K...
# feed
j
I wrote about how to write command-line tools in Kotlin Multiplatform instead of Bash https://dev.to/jmfayard/how-to-write-a-command-line-tool-with-kotlin-multiplatform-45g2
🤔 4
👍 11
K 13
n
while i’m a kotlin fan i’m not sure i’d go this way for a cli perhaps a native exec via graalvm if you really really want but more probably go (🤮) or rust (❤️)
the maven daemon is a graalvmified java app
j
I'm not making any claims on Kotlin vs Go vs Rust. All of them are better than Bash. I would pick whatever is your favorite programming language, or otherwise makes sense in your context. Now if your favorite language is Kotlin, I present how to build the CLI tool faster. I'm not sure why you would want to use GraalVM since we have Kotlin native
6
m
FYI, I think there is a typo in your first code snippet. You have:
Copy code
cd kolin-cli-starter
...which I suspect should be:
Copy code
cd kotlin-cli-starter
(BTW, nice post!)
j
Thanks Mark!
n
I’m not sure why you would want to use GraalVM since we have Kotlin native
separation of concern and speed of development with graalvm, i write my app first and then i can decide it’s not performant enough and make it a native executable i’m able to defer an important decision with kotlin native, i’ve to think about what implementations are platform-specific and design my code around that
btw, i agree with you about bash scripts needing to be short or maintained by somebody else 😂
🙂 1
m
The need for proficiency in one’s most used and favourite language (being Kotlin here), which Jean-Michel advocates, so as to employ it for shell scripting, reminded me of this: https://www.teamten.com/lawrence/writings/java-for-everything.html
n
i love kotlin and i also think that “I just choose the right language for the job” is just showing off either you a deserve a huge pay check because you know that many programming languages so well or you’ve got an inflated ego because you think you can learn a new one easily (TL;DR: syntax is mostly easy, the ecosystem... not so much) what is adequate is to choose the right language among the ones you already know that being said yes, the author write about bad experiences of choosing to use another programming language but you could find other bad experiences about choosing to use the same one 🙂 for static > dynamic, i 200% agree
👍 1