I want to create an executable cached task graph and very much want it to be purely in Scala and without the bazel python dependency.
I thought about creating a Scala library equivalent to bazel and possibly even support the same configuration files. Maybe it’s even possible to leverage AI to do most of the work.
Any thoughts on this? Does anyone else find this useful?
If you need this as a library, then maybe the best thing to do would be to talk to Haoyi and extract the relevant bits from the mill source code to a separate library.
I think this would be useful, but I also think 10 Scala geeks would have 10 different ideas about how this ought to be done. Build tools seem to be one of those things that if you care about them, you really care (and are… let’s say deeply opinionated) about them.
IMHO, the most practical practical approach to affect Scala build tooling is either:
Take a build tooling idea and integrate it into sbt, or
Take a build tool where your idea already exists, and create (or improve) the Scala integration for it
In this case, I think (2) is what you want, and bazel is the build tool in question. Maybe a Scala interface to Bazel itself (via JNI/JNA or CLI?) or some improvement to bazel’s Scala rules?
That said, if you want to essentially reimplement bazel in Scala, that sounds like fun and I’m in
We are actually working on a new build tool, Grandmaster, in Scala, that’s conceptually close to Bazel (and Nix). However, you won’t be able to define a task graph with pure Scala - build graphs are defined by a DSL (fully separate, not an eDSL)
Can you share a link to the project? Google’s only got a youtube video.
Why not let us make the build graph in Scala? It’s pretty easy to define a directed graph, and Scala’s the best tool out there for making DSLs. `->` is even making edges for you already.
@dwalend The project is not yet public. We’ve had difficulties with the first iteration of the tool - we were unable to find a good front-end language. So in the second iteration, on which we’re working on at the moment, we came up with a custom Nix-ish language. So far the results are promising, we hope to release the first open source alpha early 2026. Our intention is to release once we’re able to build izumi-reflect or a project of similar complexity.
Why not Scala: Scala is a general purpose language which provides too much freedom and our intention is to have a Turing-incomplete DSL, so the user would have much fewer opportunities to shoot at their feet. Also, Scala is not an ideal scripting language because of the high latency involved in compiling it. Currently, we run around a ~1000 tests for our interpreter in less than 5 seconds, a Scala eDSL would likely take much longer to compile that many cases.
Also Grandmaster is not intended to be a Scala-only build tool, it’s a meta build tool with a strong focus on Scala. Although at the core it’s just a markup language, a programming language on top of it, a CAS storage and a process orchestrator.