Each template gets one piece we own
A source generator in .NET, a preload plug-in in Bun, a go generate step in Go and a build_runner builder in Flutter.
Every language uses the same three parts: a marker, a finder and a written list
The idea is the same in all four templates. Each feature carries a small marker that says "I am a module". A tool finds every marked feature and writes the list that start-up needs. The difference between languages is only when that tool runs.
- In .NET and Bun the tool runs by itself, inside the compiler or before the code loads, so there is nothing to remember.
- In Go and Flutter the developer runs a command, so the tool's output can be stale until they do.
- That is why .NET and Bun are the cheapest, and Go and Flutter need a CI check for a stale list.
.NET: a source generator, and nothing to remember
The .NET row was measured on alcohol.zinc in this test Measured:
| Piece we ship | Step to remember | Known cost |
|---|---|---|
| Gen/ source generator, 251 lines | none: it runs in every build | we own and maintain it |
| [ServiceModule] marker and a registration file per module | none | one more hop in go to definition |
| partial class MainDbContext and a tables file per module | none | two namespaces in one file |
| CI line has-pending-model-changes | none | about 5 s after the build |
| Guide line for snapshot conflicts | one command, only on a clash | a new migration id for the second author |
The CI line took 4.5 s here. The real cost is owning 251 lines of generator code.
Bun: a preload plug-in, and a build script for releases
Bun was measured in an earlier test Measured:
| Piece we ship | Step to remember | Known cost |
|---|---|---|
| tools/features-plugin.ts, about 100 lines | none for run, test and watch | the list's stack-trace frame is not a file |
| bunfig.toml: preload and [test] preload | none | 4 lines |
| tools/build.ts, 20 lines | release build uses it, not bun build | the command line cannot load plug-ins |
| knip config line | none | one line, once |
The build script is the only visible cost. A developer who types bun build by habit gets the error Could not resolve: "virtual:features" instead of a build. Decide thisQ4Is the Bun release-build script acceptable?
Go: a go generate step that a developer must run
Go was measured in an earlier test Measured:
| Piece we ship | Step to remember | Known cost |
|---|---|---|
| //di:module marker per module | none | one comment line per module |
| generator for go generate | run go generate after adding a module | if forgotten, the dev server misses the module silently |
| committed wire_gen.go | none | two pull requests both touch it |
| CI freshness check | none | a conflict is fixed by re-running generate |
In Go the generated file is committed, so it is the one shared file each feature touches. A forgotten go generate is the main risk: the dev server then runs without the new module and says nothing, so CI checks that the file is fresh.
Flutter: a build_runner builder, and one command on a fresh clone
Flutter was measured in an earlier test Measured:
| Piece we ship | Step to remember | Known cost |
|---|---|---|
| build_runner builder | run build_runner on a fresh clone | about 1 minute cold |
| @Service and @AppRoute markers | none | one line per class |
| dev watch | keep build_runner watch open | press R (restart) to see a new feature |
| clean builds | delete generated files after flutter clean | Asset already exists until then |
Flutter asks the most of a developer: one command on a fresh clone, and a watch process during work.