{"slug": "a-fortran-formatter-written-in-fortran", "title": "A Fortran formatter written in Fortran", "summary": "Jacob Williams released fformat 0.1.0, a Fortran source-code formatter written in Fortran and built with Claude Opus 5.5, which formatted the 38-library, 276-file, 183,666-line fortranpack codebase in 0.555 seconds (330,667 lines/s). In Williams's benchmark, fformat was 1.3x faster than the Rust-based fprettier 0.5.0 (0.701 seconds) and 37.8x faster than the Python-based fprettify 0.3.7 (20.978 seconds), though Williams cautions the tools may not be doing identical work. Williams also created a new regex library, fregex, on top of existing Fortran packages pulled in via FPM, and argues the results undercut the case for writing such tools in Python or Rust.", "body_md": "Behold: [fformat](https://github.com/jacobwilliams/fformat) – A Fortran formatter written in Fortran. Another vibe-coded experiment, using Claude Opus 5.5, to create a quite useful tool that would not traditionally be written in Fortran. The results are just amazing.\n\nHere is a speed test using [fortranpack](https://github.com/jacobwilliams/fortranpack) (38 libraries, 276 files, 183,666 lines of code):\n\n| Tool | Written in | Version | Time (s) | Lines/s | Relative time | \n|---|---|---|---|---|---|\n| **fformat** | Fortran | 0.1.0 | 0.555 | 330,667 | 1.0x | \n| [fprettier](https://github.com/fredjones42/fprettier) | Rust | 0.5.0 | 0.701 | 261,840 | 1.3x | \n| [fprettify](https://github.com/fortran-lang/fprettify) | Python | 0.3.7 | 20.978 | 8,755 | 37.8x | \n\nObviously, there are some disclaimers here (the different tools maybe aren’t quite doing the same thing, etc. I can try and update the test to try and use consistent settings for each as best that can be achieved). But as a first cut, this is amazing! The Fortran version is slightly faster than Rust, and of course the Python one is incredibly slow.\n\nHonestly, what is the advantage any more of using Python for tools like this? Why would anyone choose a slower tool over a faster one that does the same thing? A Fortran formatter doesn’t need to be dynamic in any way. The “batteries included” argument for Python also is almost irrelevant now. I’m using a couple of existing Fortran packages via FPM, and for this project also created a brand new regex library on top of that (see [fregex](https://github.com/jacobwilliams/fregex)). And why introduce a newfangled esoteric programming language like Rust when it’s not even faster and we can do everything we need in good ole Fortran? (Don’t come after me Rust bros!)\n\nThis is all very preliminary and experimental. I’ve spent almost no time on this at all. But it seems like really getting this up to production use wouldn’t take that much effort.", "url": "https://wpnews.pro/news/a-fortran-formatter-written-in-fortran", "canonical_source": "https://fortran-lang.discourse.group/t/a-fortran-formatter-written-in-fortran/11195#post_1", "published_at": "2026-10-24 15:34:07+00:00", "updated_at": "2026-10-24 15:43:34.137590+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["fformat", "Jacob Williams", "Claude Opus 5.5", "fortranpack", "fprettier", "fprettify", "fregex", "FPM"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/a-fortran-formatter-written-in-fortran", "markdown": "https://wpnews.pro/news/a-fortran-formatter-written-in-fortran.md", "text": "https://wpnews.pro/news/a-fortran-formatter-written-in-fortran.txt", "jsonld": "https://wpnews.pro/news/a-fortran-formatter-written-in-fortran.jsonld"}}