cd /news/developer-tools/i-come-to-bury-mod-files-not-to-prai… · home › topics › developer-tools › article
[ARTICLE · art-141295] src=fortran-lang.discourse.group ↗ pub= topic=developer-tools verified=true sentiment=· neutral

I come to bury .mod files not to praise them

A developer's proposal to replace Fortran .mod files with a per-project database that records every USE statement and each public entity's interface fingerprint would stop unnecessary recompilations at the entity level rather than the file or module level, according to the developer's account of a Claude Code exchange. The developer argues that in a dependency chain A uses B uses C uses D, a change to D's private implementation would halt the recompilation chain at D instead of forcing rebuilds of C, B and A. The proposal contrasts with .mod files, which the developer describes as binary, opaque and forcing an all-or-nothing decision, while the database would handle ONLY-clause filtering and store the consumer's view of the interface.

read1 min views1 publishedSep 28, 2026

I asked Claude Code a question:

Q: btw, thinking about a system to keep Fortran MODULE and SUBMODULE information, I imagine an alternative that uses a per-project (software library or executable) database to keep track not only of timestamps for source files but also of “uses”. For instance, for each MODULE X, the database would record each individual USE statement (naming that same MODULE X) in any other source file/program unit/scope. Can you describe how that would cut down on unnecessary recompilations?

A: The key insight is that current build systems operate at the wrong granularity – they track file-level or module-level dependencies, but recompilation necessity is determined at the entity interface level. Here is how a USE-tracking database would help:

WHAT THE DATABASE RECORDS

For every compilation unit that contains a USE statement, it records not just “file B uses module M” but:

For each module definition, it records the interface fingerprint of every public entity.

HOW UNNECESSARY RECOMPILATIONS ARE ELIMINATED

THE PROPAGATION ALGORITHM

When source file F is recompiled and module M is regenerated:

COMPOUNDING BENEFIT ACROSS DEEP DEPENDENCY GRAPHS

In a hierarchy A uses B uses C uses D, a change deep in D affecting only its private implementation would currently force recompilation of C, then B, then A. With the database, the chain stops at D immediately.

RELATION TO EXISTING .MOD FILE APPROACHES

.mod files are binary/opaque and force an all-or-nothing decision. The database reasons at the level of individual entities, handles ONLY-clause filtering, and stores the consumer’s view of the interface rather than just what the module currently exposes.

── more in #developer-tools 4 stories · sorted by recency
── more on @fortran 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-come-to-bury-mod-f…] indexed:0 read:1min 2026-09-28 · —