by iamcalledrob · 2y ago · 0 comments
At first glance, Mill looks like it has many of the pitfalls of Gradle: - Plugins: Creates the temptation to rely on plugins for everything, and suddenly you're in plugin dependency hell with no idea how anything actually works. - Build scripts written in a DSL on top of a new language: Now I have to learn Scala and your DSL. I don't want to do either! - Build scripts written in a language that can be used for code too: Versioning hell when the compiler for the build system needs to be a different version to the compiler for the actual project code. See: Gradle and Kotlin
Examples:
* Github Actions Config Expressions https://docs.github.com/en/actions/writing-workflows/choosin...
* CloudFormation Functions https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGui...
* Helm Chart Templates https://helm.sh/docs/chart_best_practices/templates/
There is a reason why Bazel went with Python/Starlark, why Pulumi and CDK and friends are getting popular. Fundamentally, many of these use cases look surprisingly like programming languages: maybe not immediately, but certainly after you've dug in a bit. And having a properly designed purpose-build programming language (e.g. StarLark) or a flexible general purpose language (e.g. Typescript, Kotlin, Scala) does turn out to be the least-bad option
(Though, debugging complicated Starlark code can still be difficult.)
So why not use Starlark? :)
- Global publishing and distribution infrastructure
- IDE support in multiple IDEs
- A huge ecosystem of third party packages, both Scala and Java
- An excellent Scala standard library and Java standard library
- Good performance.
- Tooling! Jprofiler is great. Others use Yourkit or JFR.
- Mill leans havily on Scala's FP/OO hybrid style with types, while starlark provides none of that and is purely untyped procedural code
Greenspun's tenth rule.
The implementation may not be the theoretical best, but I think the idea is pretty much the perfect build system out there.
> Mill can build the same Java codebase 5-10x faster than Maven, or 2-4x faster than Gradle
Speed per se can be a good selling point (having to wait for slow builds is really annoying).
I can't really comment on anything else though as I just stumbled upon it here in HN ;)
https://github.com/apache/maven-build-cache-extension
Because in my experience, this makes Maven very, very fast.
Maven has never been relevant to the Scala ecosystem given most of the community has pretty much moved straight from ant to sbt. Only a few Spark related projects stubbornly use Maven, which is a major pain given the lack of cross-building abilities. Slow dependency resolution and inefficient use of Zinc merely add insult to injury.