DEV Community

Discussion on: How to Write a Command-Line Tool with Kotlin Multiplatform

Collapse
 
jcshartz profile image
jcshartz

I'm confused "biggest issue with writing a CLI in a JVM language" comment. If a dev is already doing Kotlin wouldn't writing CLI tools in a language they are familiar with be useful? When the target is native, you don't need a JVM to run the resultant code.

Collapse
 
alanmasciangelo profile image
Alan Masciangelo

Aren't you fairly limited in the libraries you can use when building native though? Is being restrict to C library wrappers really better than canonic GNU programs?

Thread Thread
 
jcshartz profile image
jcshartz • Edited

I would say this is a matter of how comfortable one is using bash versus how comfortable one is using Kotlin. As someone who uses Kotlin on the regular, I can visualize the business logic better in that language and the developer tools are more familiar to me. Additionally, if your CLI tool is doing less interaction with GNU tools and more processing and you are very comfortable with Kotlin then Kotlin CLI might be more for you... especially if you don't need to write a lot of CLI tools. Also if you are writing a tool that is targeted to multi-platform then this is exactly what you want to do if Kotlin is your primary language as you would only need to write the business logic once.

But I agree with your statement in general.