Announcing a new tool available for those of you adopting GenAI coding tools. It would violate ISO copyright (I think) for me to distribute a vector database containing the contents of the Fortran Standards directly, but what I can do is give you the tools to create and run your own MCP server on your own machine with whichever revisions of the Fortran standard you have available to you. Instructions are provided for creating the needed vector database from pdfs of the standard, configuring claude code to use the included MCP server, and a skill file to make your agents more efficient at using it. I welcome any feedback or contributions if anybody has them.
I wonder, would it make sense to combine with this project somehow Fortran MCP – Local MCP server providing curated Fortran documentation for AI-assisted development ?
Almost certainly.
@everythingfunctional this is excellent. Does it speedup how quickly the AI agent can lookup things?
I’ve been making it search the pdf document directly in Grok and that works, but I notice that every time it searches the pdf, it’s quite slow and sometimes not always precise.
I also tried translating the standards pdf document to Markdown, for an easy search / analysis by AI, but it’s hard too to do that to make the formatting look good.
Do you know if there is a way to also generate the standards document as Markdown (or LaTeX) instead of just a pdf? It could be any of the drafts, not the final product.
In a perfect world, the latex source that produces the pdf files would be available publicly, maybe from Overleaf.
You mean like how they do exactly that for C++?
Why doesn’t Fortran do this?
@sblionel, do you know if it would be possible to put the LaTeX sources of the standard online? It seems that ISO allows that if C++ can do it. This would be really helpful so that it’s easier to deal with (both for AI as well as just be able to write various scripts like extracting all intrinsic functions and their signatures, or extracting the grammar etc.). One can do it from the pdf, but it takes longer and it’s not perfect, so requires various fixes, so it adds friction.
Does it speedup how quickly the AI agent can lookup things?
It doesn’t just affect the speed, it affects the quality of the answers. With PDF, the agent has to “think” about each PDF tool call and then has to ignore the page formatting. This wastes context and pollutes the thinking process. I actually converted PDF to a clean Markdown, and for me this gives excellent results.
Could you upload the Markdown?
Quite a bit. I’m using it with small local models and still having good success.
My understanding is that because the published standard is an ISO copyrighted document, we can’t make the contents publicly available. In other words, if we put the LaTeX source in a public repo, we would be violating ISO copyright. I don’t know what the C++ committee is doing to avoid this, or if they’re just ignoring ISO, or claiming it’s not the actual published document?
It’s the draft standard. Fortran does the same, but only the PDF and not the source
I was aware that WG21 used GitHub for their standard sources but not that there was public access. I note the disclaimer in the README, but I wonder if that is really sufficient should ISO decide to go after them, especially after JTC1 recently rejected SC22’s request to maintain public access to WG documents other than the standard itself. (The standard and drafts beginning with the CD stage are considered ISO Copyright and aren’t allowed to be public.)
Currently, the Fortran standard’s source is kept in a Subversion repository, not git, but I recognize that’s a side-issue.
I’m going to ping the WG21 Convenor to get their thoughts and experience with this.
Thank you @sblionel, much appreciated!
Funny, I did the same! But I only cleaned up maybe 50 pages, the rest of the ~700 pages are not clean, the formatting is off etc.
The WG21 Convenor replied that he was busy with an upcoming meeting but would get back to me by the end of the month. I’ll update when I hear from him again.