Hacker News new | ask | show | jobs
by elric 818 days ago
> For example, writing scripts on JVM languages would require additional effort to build a toolchain that compiles and runs files on the fly, with a short start time.

That hasn't been true since at least Java 11. You can execute any .java file using `java foo.java`. No compilation required. You can reference dependencies using the usual classpath options etc.

Startup time is minimal.

Been using such scripts in exactly the way the author suggests for years. Much more pleasant than messing around with maven or gradle plugins.

1 comments

> You can reference dependencies using the usual classpath options etc

I don't know anyone who thinks that a java script (being the main project language) is going to surpass:

#!/bin/sh

dep-start.sh

./gradlew clean bootRun

Maybe there are outliers with this "hot take". The result of years of projects (even changing hands), are a lot more instructive than someone posing theoretical value of reusability.

That example doesn't even need a script, it could literally be a single gradle task. Some things are lot easier to do in a platform independent way in Java (or Groovy) than in shell scripts. And unlike the latter, the former can be tested just like any other part of the code base.

It always bugged me that build scripts are hardly ever tested or engineered. They just grow into giant balls of mud.