Get the latest tech news

Why does Mill use Scala?


One question that comes up a lot among Mill users is why use Scala as the language to configure your build? Why not YAML, XML, TOML, Bash, Groovy, Python, Java, or any of the other hundred programming and configuration languages in widespread use today? Scala is definitely a niche language, but it also has some unique properties that make it especially suitable to be used for configuring the build system of a small or large project. For the purposes of this page, we will break down this topic into three top-level questions: why Mill uses a general-purpose programming language, why Mill uses the Scala Language, and why Mill wants to run on the Java Virtual Machine Why a General Purpose Language? While Mill uses a general-purpose programming language (Scala), many build tools use restricted config languages instead, or their own custom tool-specific languages.

And this is not just a superficial resemblance, but the semantics deeply match what you would expect in a hybrid functional/object-oriented program: Mill supports instantiating modules, subclasses, inheritance via extends, override, super, and so on. While Maven Central isn’t perfect, it does a solid job as a package repository: hosting an enormous catalog of artifacts for the Java community to build upon, with nice properties such as namespacing, discoverability, immutability, and code signing. Most build tools end up with some half-baked plugin distribution model: downloading source code off of Github, ad-hoc package formats or zip files, published artifacts that can be sneakily changed or even deleted after the fact, and so on.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Mill

Mill

Photo of Scala

Scala

Related news:

News photo

Work at the Mill: The story of Digital Equipment Corporation

News photo

Compiling Java into native binaries with Graal and Mill

News photo

Abacist – Calculations with non-decimal units and mixed bases in Scala