Side effects are actually bad for build systems. An efficient and flexible build system really wants targets to be pure functions with inputs and outputs that are known to the tool, because that enables complex features to be built on top, like cross-machine build caching or remote build execution.
Yep - and the linked paper even has a good foundation for how to do that. If we model a build as "bringing values for keys up to date in stores" that is enough to plug and play every part of a build system.
That is the more interesting design to pursue for sure.
I don't think anyone would want to use this tool for real work, but it might have value for teaching, because build graphs are a structure that's repeated in most (all?) build tools.
I think that a lot of people have actually zero use for minimal builds. Computers are fast and already many people start their builds in CI with`mvn clean`.
Don't need builds at all? Launch your program via source.
Don't need build caching? Write a program that builds your code.
Don't need cross-machine caching or remote execution? Decorate that program you wrote with a target or two
Actually need everything? Break out bazel
If you switched to that model, you could also merge the concept of input files into the Target structure. An input file should just be a Target that outputs the relevant file. By working with Targets and not Paths, you enable those more complex features to be built on top.
My thesis here isn't that this is the best possible build library for every use case. It is that we would be in a better place, culturally, if we had a healthy ecosystem of libraries which manage building.
Some other build systems already do this. Bazel delegates "procure dependencies" to various external tools depending on the language you're working with, for example delegating fetching Maven artifacts to https://github.com/coursier/coursier.
Right - and i've had a pure java version of coursier on my github for quite awhile (jresolve). The problem for me isn't power users. You get to the point of using Bazel and you already have many salaries looking at your problems. It is everyone from beginner to intermediate that needs a better learning path and more "fall off points".
I think that a lot of people have actually zero use for minimal builds. Computers are fast and already many people start their builds in CI withmvn clean.
Yes, but that is not the same as those people wanting to write their own build system from nearly-scratch.
My thesis here isn't that this is the best possible build library for every use case.
Sure, I'm just pointing out that there is a better model for Targets that you might want to consider switching to. Your plugin architecture (Target) actually looks a lot like the one from Maven (note that the execute method returns void, just like your build), which is not ideal because I think we've learned since then that this kind of API is a bit too free-form, and something based on defined inputs and outputs composes better.
Being this free-form makes coupling in the build worse, because the framework doesn't provide target B with any information about what A output, so B's code ends up having to know where A happens to put its files.
This makes it harder to write reusable components on top of these interfaces.
It is that we would be in a better place, culturally, if we had a healthy ecosystem of libraries which manage building.
But we already do, though.
Many of the popular build tools, like Maven, Gradle, Bazel or Mill, are not inherently monolithic or complex. They are built with a somewhat narrow core set of functionalities, and then everything else is provided via plugins.
For example, Mill provides some core functionality to define targets as functions that take input and produce output, and then everything else is provided via plugins built on top of those interfaces.
As another example, Maven is just a framework for executing plugins, all the targets that exist in a normal build are just plugins that are loaded by default.
These plugin-based architectures often include dependency management. Maven has a plugin for Aether, Bazel has a plugin for Coursier, and Mill has a plugin for Coursier. Gradle used to use Ivy, until they wrote their own resolver.
So the difference between your library and existing build tools isn't really simplicity. It's just that no one has written reusable plugins for your tool yet, so it looks simple because it's still bare-bones. If your tool became popular, and people started writing plugins for it, it would probably end up the same way as those other tools.
Right - and i've had a pure java version of coursier on my github for quite awhile (jresolve)
I'll admit to not really seeing the value. Coursier already runs on the JVM, not sure why a Java clone is needed.
It is everyone from beginner to intermediate that needs a better learning path and more "fall off points".
Absolutely.
But I think it's very likely that what newbies/small-scale developers would benefit from is not another build tool, it's pedagogical documentation to help them get started with the build tools that already exist.
At their cores, a lot of the existing build tools are conceptually very simple, it's just that their docs are often not that easy to follow if you haven't seen a build system before.
Tutorial-style documentation that starts from an empty directory and builds out a small example project with Maven/Gradle/Mill, while explaining the concepts being used, would probably help newbies more than a new build tool they can't use outside toy-sized projects.
View all comments
Show parent comment
1
u/bowbahdoe Jul 12 '26
Yep - and the linked paper even has a good foundation for how to do that. If we model a build as "bringing values for keys up to date in stores" that is enough to plug and play every part of a build system.
That is the more interesting design to pursue for sure.
I think that a lot of people have actually zero use for minimal builds. Computers are fast and already many people start their builds in CI with`mvn clean`.
My thesis here isn't that this is the best possible build library for every use case. It is that we would be in a better place, culturally, if we had a healthy ecosystem of libraries which manage building.
Right - and i've had a pure java version of coursier on my github for quite awhile (jresolve). The problem for me isn't power users. You get to the point of using Bazel and you already have many salaries looking at your problems. It is everyone from beginner to intermediate that needs a better learning path and more "fall off points".