-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize common tasks even if they are simple to implement #97
Comments
I think my comment in #96 about consideration of a standard library might be more appropriate to raise here. I know that the C standard library developed more historically than by design, but I think that C's approach has allowed its language to stay compact, while letting libc deal with implementation of tasks such as the ones you describe. I'm not familiar with C++, but it seems like they've also gone in a similar direction. I could see a standard library also offloading many of these discussions out of the Fortran discussion and into, say, a group devoted to such a library. I could also imagine a standards-defining implementation (glibfort?) alongside vendor implementations, who could focus on optimizations suited for their target platforms. It could also clarify exactly what can and cannot be done with Fortran itself. If a particular intrinsic cannot be written in Fortran, then it's likely that the language either needs an extension, or is a task that one probably ought not be doing in Fortran. To address your points, a standard library would help to achieve your goals:
I could list the various things that I would like to see in such a library, but I'll hold my tongue for now 😝. |
Note that a Fortran processor can provide non-standard intrinsic modules. In principle if these are described accurately enough, other vendors can also implement them. If licensed permissively they may even be inclined to share their implementation. I just discovered this fact here: https://fortran-lang.discourse.group/t/does-an-intrinsic-module-have-to-be-part-of-the-standard/6555/2 |
We can similarly argue for even simpler things missing in the language that is so obvious and trivial, yet a constant source of pain and torture, like |
Real numbers are not practically universally considered a subset of complex numbers. In many cases, real numbers are considered isomorphic to a subset of the complex numbers. That would mean that |
or the committee can refocus on what matters practically to BLAS, LAPACK, machine learning numerical libraries, and Fortran practitioners, and learn from other generic numerical computing languages that have grown their community to four times that of Fortran in less than one-fourth of Fortran lifetime by paying more careful attention to what users and ML algorithms need. Coercion to complex, conjugation, and conversion back to real does not seem viable in numerical algebra routines. |
A common sentiment against standardizing relatively simple routines for common tasks such as
diag
(#14), string manipulation such assplit
(#96) and other similar proposals is that such features are simple for users to implement themselves and as such are not worth putting into the standard.The counter argument is that if simple things are not standardized, then every user reimplements them in slightly incompatible ways over and over again, and it slows down productivity. As an extreme example, C++ follows this approach also, and did not standardize the syntax for multidimensional arrays (the language itself provides enough primitives for users to implement their own) and as a result C++ has dozens and dozens of incompatible array implementations.
Fortran, unlike C++, has standardized such "simple" things as multidimensional arrays, special functions, and everything else that is needed in practice for numerical computing.
It would be nice to develop general guidelines of what features are worth standardizing and which not, so that we do not need to repeat such arguments in every issue.
The text was updated successfully, but these errors were encountered: