We implemented a prototype of F202Y generics in LFortran, as proposed by the generics subcommittee (@tom_clune, @everythingfunctional, @gak, @FortranFan, @rouson and others). You can test it locally by using the default LLVM backend (make sure you use the latest LFortran from git), or you can test it online at https://dev.lfortran.org/, at the top left click on Examples → experimental, select one of the 7 examples and click on Run. (The online WASM backend is less mature than our LLVM backend, but it is usable.)
Can you please try it out and give us feedback?
Here is our TODO list of things that we know about: Templates TODO · Issue #1199 · lfortran/lfortran · GitHub.
This is an important feature for Fortran and it is crucial that we get this right. Here is how we are approaching it:
- We got support of the Fortran Standards Committee, and it formed a generics subgroup
- The subcommittee has been meeting biweekly and iterating on the design and writing papers
- We have written a prototype in a compiler. So far we have LFortran and I invite other compiler vendors to also create a prototype.
What we need now is an involvement of the wider Fortran community to try the prototype and provide feedback. If you like it, please let us know. If you don’t like it, please let us know, and let’s improve the design. I think it would be great if you could use it and write some algorithms using it and please share your experience actually using the generics. In my opinion, that is how to get new features in: we should use them first, and only after we get enough experience, we should standardize them.
(LFortran is in advanced alpha, so you will hit bugs, but it should be possible to workaround them, just report all bugs to our issue tracker and we’ll help you.)