# FDOC: a Fortran documenter, written in Fortran

**URL:** <https://fortran-lang.discourse.group/t/fdoc-a-fortran-documenter-written-in-fortran/11269>\
**Category:** AI\
**Created:** [November 1, 2026, 7:38pm UTC](https://fortran-lang.discourse.group/t/fdoc-a-fortran-documenter-written-in-fortran/11269 "2026-11-01T19:38:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacobwilliams](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jacobwilliams/32/10_2.png) [@jacobwilliams](https://fortran-lang.discourse.group/u/jacobwilliams)\
**Post date:** [November 1, 2026, 7:38pm UTC](https://fortran-lang.discourse.group/t/fdoc-a-fortran-documenter-written-in-fortran/11269/1 "2026-11-01T19:38:02Z")

</div>

Continuing the logical progression from [A Fortran formatter written in Fortran](https://fortran-lang.discourse.group/t/a-fortran-formatter-written-in-fortran/11195), i present [fdoc](https://github.com/jacobwilliams/fdoc), a drop-in replacement for FORD, written completely in Fortran.

Here are the dependencies (all compiled via FPM):

 ![fdoc-dependencies](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/1/1e1918df003d845b69bf4a51a7e53d48c5aae43a.png)

Fdoc depends on [fformat](https://github.com/jacobwilliams/fformat) to do the actual Fortran parsing/tokenization. [Fdot](https://github.com/jacobwilliams/fdot) is another new library, a port of just the parts of Graphviz that we need, so we don’t have the overhead of calling an external dependency for the graphs either. Fdoc also understands fypp, so we don’t need Python to do the preprocessing either (note: I’ve only ported the parts used by stdlib, so there is room for improvement there probably). Finally, OpenMP-based parallelization is used to speed up the entire process (parsing files, preprocessing, generating graphs, etc.)

Example output can be [seen here](https://jacobwilliams.github.io/fdoc/index.html).

The speed comparison is staggering. This table shows the time to generate each project’s documentation, using the project’s own settings (i.e., from the the `ford.md` file):

| Project | Lines | FORD | fdoc | Speedup |
| --- | --- | --- | --- | --- |
| [fformat](https://github.com/jacobwilliams/fformat) | 6,902 | 27.1 s | 0.1 s | 226× |
| [bspline-fortran](https://github.com/jacobwilliams/bspline-fortran) | 13,222 | 22.8 s | 0.1 s | 163× |
| [rklib](https://github.com/jacobwilliams/rklib) | 17,025 | 62.3 s | 0.2 s | 271× |
| [json-fortran](https://github.com/jacobwilliams/json-fortran) | 17,715 | 64.5 s | 0.6 s | 115× |
| [Fortran-Astrodynamics-Toolkit](https://github.com/jacobwilliams/Fortran-Astrodynamics-Toolkit) | 25,174 | 60.3 s | 0.2 s | 274× |
| [qt-fortran](https://github.com/jacobwilliams/qt-fortran) | 25,831 | 314 s | 0.9 s | 338× |
| [stdlib](https://github.com/fortran-lang/stdlib) | 614,270 | 680 s | 2.3 s | 297× |

So no Python needed at all, orders of magnitude faster!

---

<div class="post-metadata">

**Author:** ![han190](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/han190/32/7158_2.png) [@han190](https://fortran-lang.discourse.group/u/han190)\
**Post date:** [November 1, 2026, 8:50pm UTC](https://fortran-lang.discourse.group/t/fdoc-a-fortran-documenter-written-in-fortran/11269/2 "2026-11-01T20:50:15Z")

</div>

I tried fformat a few days ago, and it works amazingly good (and fast). It meets all my requirements and integrates well with fpm. I am definitely going to try fdoc as well. Many thanks!

Given your progress, do you think current AI is mature enough to write a standards-compliant Fortran parser in modern Fortran? Both fformat and fdoc could benefit from such a parser. In the era of AI, these tools would do more than just make source code look better. They could provide cleaner training data and tools for AI coding agents to analyze source code directly. ChatGPT seems quite optimistic about this, but I would also like to hear some human perspectives.

---

<div class="post-metadata">

**Author:** ![linwaytin](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@linwaytin](https://fortran-lang.discourse.group/u/linwaytin)\
**Post date:** [November 1, 2026, 8:52pm UTC](https://fortran-lang.discourse.group/t/fdoc-a-fortran-documenter-written-in-fortran/11269/3 "2026-11-01T20:52:32Z")

</div>

The default theme seems much better than FORD!
