-
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
Standard library proposals #104
Comments
I think this is a great idea. The Indeed, currently the committee always puts the carriage in front of the horse. The fix for language features is to first implement them in a compiler. That will come in a few years, hopefully even sooner. But for library additions (this feature), the fix is to first implement them in the "standard library", get it used in projects, gain some experience, and then write up a proposal and get it into the standard. What should we call this library? |
FYI: @apthorpe had some good thoughts about this a couple years ago: |
An ancillary issue is how much of such a library should be written in Fortran itself. Most libc implementations that I've seen are predominantly written in C, with occasional assembly code (most notably At the risk of repeating myself, I think the answer to this question would help to more strongly define what can and cannot (or ought and ought not) be done within the constraints of the language itself, and perhaps reveal more precisely when an extension of the core language is required. Another issue is whether particular intrinsics ought to be part of such a library, rather than part of the language itself. I know that my own group would like more control over the behavior of many transcendental functions like Overall, I am very supportive of something like this and would love to contribute to its development. |
@certik I don't know about the name, for the time being we can refer to it as just standard library, and see if it meets adversity. My guess is that it'd be welcome and embraced by most of the community. If a better name candidate comes up, we'll know. More important are the processes that we adopt to elect candidates for stdlib, and how to implement them. Your strong experience with SymPy will come in useful here as well. I think a good model in the beginning would be for stdlib candidates to evolve from certain proposals in this repo. If it's a request for adding an intrinsic procedure or module to the language, we tag is as stdlib-candidate, and issues that gather strong support by the community can "level up" to experimental implementation in the stdlib. The stdlib could be another repo under github.com/j3-fortran. This repo would also be a place to include unit and regression tests, benchmarks, and of course the stdlib docs. @marshallward Good points, and I don't see a good reason to limit this to pure Fortran implementation. For example, sorting can be done with pure Fortran, but file system procedures would need quite a bit of C. I think this is OK. Whether some intrinsics should be part of a 3rd party library or part of the language, we'll learn that along the way. If we find that a procedure or module should be standardized, we'd use this as a stepping stone in that process. |
@milancurcic I agree. Let's call it the "Fortran Standard Library", or @sblionel what do you think? |
@certik wrote:
@milancurcic , @certik, @marshallward , It's great to see your enthusiasm toward this effort, the value of this to the Fortran community is immeasurable and priceless. I really hope the ISO IEC working group WG5 will wholeheartedly support and cooperate with such an initiative. It will be truly remarkable if
|
@jacobwilliams wrote:
Agree. Thoughts by @apthorpe under the "Release and Distribution Model" e.g.
are particularly important for all the users I work with. |
For the past five years I've been programming in Fortran, I have always felt there is a lack of a central library for common things such containers, string handling, IO, etc., but also general numerical routines for interpolation, LAPACK interfaces, ODE solvers, evaluating polynomials and more. It seems like each of us has (re-)implemented these tools at some point in time, wasting lots of human hours. Ironically, many wrapped Fortran libraries are much easier to use from Python (via SciPy) than from Fortran itself. Would a Fortran Finally, I wanted to mention the Flibcpp project which provides Fortran bindings to the C++ standard library using auto-generated code from SWIG-Fortran. Would we allow the Fortran standard library to have different backends (e.g. via submodules)? For example one with "hand-written" Fortran/C routines, and another one which is just a thin wrapper of the C++ one. It would be interesting to see if this library effort gained momentum, would the compiler vendors slowly shift to this standard library interface and provide there own specialized implementations (kind of like the Intel distribution of Python which has linked up Numpy/SciPy with the Intel Math Kernel Library). |
I'm very heartened to see this pick up again, especially with people I've
met since I originally posted my thoughts on the matter. I've been working
with C++ and the Boost library for about a year and I like their approach.
A number of Boost proposals and libraries have made it into the C++
standard library with minor modifications. This allows early adopters to
exercise the code, find limitations, etc., prior to making a proposal to
the standards committee. Much of the developmental 'churn' takes place long
before standards proposals are made. When Boost libraries are accepted to
the standard library, it's usually very easy for end-developers to migrate
from Boost to stdlib routines.
My preference is to concentrate on areas where traditionally there hasn't
been much emphasis, especially data import/export, string processing,
containers, and search/sort. Numerical code is covered well (for example,
Intel Fortran ships with optimized versions of BLAS/LAPACK). Regular
expressions, hashes (dict/map/associative array), and data validation and
import utilities would substantially reduce the burden of parsing,
processing, and validating input. I've seen a surprisingly large fraction
of application code devoted to input processing, much of which could be
improved or eliminated with regexes or hashes.
As for implementation language, I wouldn't limit it to just Fortran. While
one can write a regular expression library in Fortran, one probably
shouldn't, especially when C++11 already has a perfectly usable regular
expression implementation. My inclination is to stay with mature
standardized languages such as C++, C, etc. If Fortran is workable, great;
in many cases it isn't. To simplify adoption, it may be wise to restrict
implementation languages to C, C++, and Fortran, at least initially.
…On Sun, Dec 1, 2019 at 6:22 AM Ivan ***@***.***> wrote:
For the past five years I've been programming in Fortran, I have always
felt there is a lack of a central library for common things such
containers, string handling, IO, etc., but also general numerical routines
for interpolation, LAPACK interfaces, ODE solvers, evaluating polynomials
and more. It seems like each of us has (re-)implemented these tools at some
point in time, wasting lots of human hours. Ironically, many wrapped
Fortran libraries are much easier to use from Python (via SciPy) than from
Fortran itself.
Would a Fortran stdlib also cover such routines for numerical work or
should there be a second library for scientific Fortran routines? I imagine
the scientific library would more or less reimplement what the NAG
<https://www.nag.com/numeric/fl/nagdoc_latest/html/frontmatter/manconts.html>
library and the former IMSL
<https://www.roguewave.com/products-services/imsl-numerical-libraries/fortran-libraries>
library (now RogueWave) already have. I wonder if perhaps these two
libraries might be the reason why we have no open-source scientific Fortran
library, as many Fortran users would simply buy a license.
Finally, I wanted to mention the Flibcpp
<https://github.com/swig-fortran/flibcpp> project which provides Fortran
bindings to the C++ standard library using auto-generated code from
SWIG-Fortran. Would we allow the Fortran standard library to have different
backends (e.g. via submodules)? For example one with "hand-written"
Fortran/C routines, and another one which is just a thin wrapper of the C++
one.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#104?email_source=notifications&email_token=AAIPODKKOFJOIL2PXZBD72LQWOT6ZA5CNFSM4JSZ6FO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFRHOEQ#issuecomment-560101138>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIPODPAE55AXSTR5R3MJCLQWOT6ZANCNFSM4JSZ6FOQ>
.
|
As a first step towards a standard library, i think it would be useful if we had a complete list (as possible) of currently available open source projects/libraries that address the things that most people would agree are of immediate need (for me thats enhanced string handling, sorting, and ADT containers and algorithms (lists, dictionaries/unordered maps, stacks, queues, etc.). If the authors of the projects are ameanable, their code could be forked into a standard repostitory that aggregates the code into one place. Then we could begin a community effort to evaluate the various ways people implemented the needed functionality we envision for a standard fortran library and write reveiws on what we liked about their approach, what we didnt' like and how appropriate the code would be as a candidate for inclusion into the standard library. I think this would also benefit the original authors because it would provide useful feedback for their individual projects. We could also encourage people to consider placing their code on the repository first prior to standing up their own github site. |
This is just a small contribution, but I did come up with a way of storing arbitrary data, with run-time type-checking: https://github.com/cmacmackin/PolyCon. At one point I'd planned to use this to build a bunch of ADT containers, but I never got around to it. The code is currently GPL licensed, but I'd be willing to release it under something more permissive if people could find a use for it. |
|
@sblionel what do you think of this effort? What would be the best way to get an approval / blessing by the committee for this, per the discussion above? |
@certik I don't see that any committee approval or blessing is needed for this. The 202X work list includes some features that such a library might find useful, though that of course means one can't implement things until compilers have those features. Early implementations might get revised once the features become available. The idea of a "stdlib for Fortran" has a lot of appeal, and what I have suggested before is that proponents put together a list of what they think such a library should contain. This might influence future standardization direction, especially if prototype implementations highlight a need for certain features. It would be great if some version of this library were used in a production application, with observations of how it helped and how general its application was. The standard has many features that were first implemented outside the standard. |
@sblionel I think this is exactly the kind of "blessing" we were looking for, at least IMO. Fortran stdlib can (and should) exist in parallel to the language standard, and shouldn't be confused for it. Parts of it may eventually become part of the language. |
FWIW, I found a few simple and promising projects for testing and regular
expressions (PCRE) - see https://github.com/pdebuyl/fortran_tester and
https://github.com/ZedThree/fortran_pcre. I agree that surveying existing
projects and approaching the authors would help, both to recognize work
that has already been done and to show there's community interest and
support. I contributed back documentation, test, and build infrastructure
(Doxygen, CTest, CMake); my preferred environment is linux/unix, but I've
worked in mainly in Windows shops so I try to keep code and builds
platform-neutral (hence CMake). Regardless, I'd like to follow a Boost
model where we can deliver a consistently documented and tested suite of
cross-platform routines, relatively low impact on developers (i.e. does not
require bleeding-edge tools or complex dependencies or weird manual
configuration to build). I'm thinking Principle of Least Work - make this
easy for developers to standardize on, a solid 80% solution
…On Sun, Dec 8, 2019 at 6:29 PM Milan Curcic ***@***.***> wrote:
@sblionel <https://github.com/sblionel> I think this is exactly the kind
of "blessing" we were looking for, at least IMO. Fortran stdlib can (and
should) exist in parallel to the language standard, and shouldn't be
confused for it. Parts of it may eventually become part of the language.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#104?email_source=notifications&email_token=AAIPODK4BJDSYIZJ7ENMQC3QXWGNNA5CNFSM4JSZ6FO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGHPHGQ#issuecomment-563016602>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIPODOHNR3HXRSHHXORAELQXWGNNANCNFSM4JSZ6FOQ>
.
|
Thank you @sblionel for the blessing. @milancurcic do you want to take the lead on this effort? We can call it For example, speaking for myself, if the API is good enough, and if the library can be both installed on all platforms using cmake, as well as if it works if I simply copy relevant modules to larger production codes (I think this is aligned with @apthorpe's recommendations), I'll be happy to use it instead of https://github.com/certik/fortran-utils/. If authors of similar projects will do the same, then I think this will be successful. |
Today I was having a look at a few Fortran libraries (some of them very
small) and was extremely taken aback by inability to compile them without
using CMake. Please keep in mind that CMake is extremely bloated and I find
using it to compile it 3 files a bit ridiculous and an overkill. For 90% of
the projects that people use cmake for, a simple well-written makefile is
more than enough. So in my opinion, requiring this one particular build
tool for project to be acceptable as stdlib candidate is a mistake and
completely against the goal. It is enough requirement that the makefiles
follow all the basic conventions (such as target and variable names).
wt., 10 gru 2019 o 06:25 Ondřej Čertík <[email protected]>
napisał(a):
… Thank you @sblionel <https://github.com/sblionel> for the blessing.
@milancurcic <https://github.com/milancurcic> do you want to take the
lead on this effort? We can call it stdlib, and create some GitHub
organization to host it under, and I think a key to its success is to get
all the people who have created similar "utility" libraries in the past on
the same page (I think we mostly already are) and then ensure that the API
of the stdlib is "approved" by those people as well as the wider community.
For example, speaking for myself, if the API is good enough, and if the
library can be both installed on all platforms using cmake, as well as if
it works if I simply copy relevant modules to larger production codes, I'll
be happy to use it instead of https://github.com/certik/fortran-utils/.
If authors of similar projects will do the same, then I think this will be
successful.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#104?email_source=notifications&email_token=AC4NA3OOAOETTGEXCWICS5LQX4R3LA5CNFSM4JSZ6FO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGNYNDQ#issuecomment-563840654>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC4NA3J4YD6FFB4OHEEKHILQX4R3LANCNFSM4JSZ6FOQ>
.
|
I think we all agree on this one, see my last comment where I stressed that it must be possible to simply copy the relevant modules to your project and things should just work. We should also maintain regular simple Makefiles for the same reason. CMake should only be optional.
…On Mon, Dec 9, 2019, at 10:49 PM, Dominik Gronkiewicz wrote:
Today I was having a look at a few Fortran libraries (some of them very
small) and was extremely taken aback by inability to compile them without
using CMake. Please keep in mind that CMake is extremely bloated and I find
using it to compile it 3 files a bit ridiculous and an overkill. For 90% of
the projects that people use cmake for, a simple well-written makefile is
more than enough. So in my opinion, requiring this one particular build
tool for project to be acceptable as stdlib candidate is a mistake and
completely against the goal. It is enough requirement that the makefiles
follow all the basic conventions (such as target and variable names).
wt., 10 gru 2019 o 06:25 Ondřej Čertík ***@***.***>
napisał(a):
> Thank you @sblionel <https://github.com/sblionel> for the blessing.
>
> @milancurcic <https://github.com/milancurcic> do you want to take the
> lead on this effort? We can call it stdlib, and create some GitHub
> organization to host it under, and I think a key to its success is
to get
> all the people who have created similar "utility" libraries in the
past on
> the same page (I think we mostly already are) and then ensure that
the API
> of the stdlib is "approved" by those people as well as the wider
community.
>
> For example, speaking for myself, if the API is good enough, and if
the
> library can be both installed on all platforms using cmake, as well
as if
> it works if I simply copy relevant modules to larger production
codes, I'll
> be happy to use it instead of
https://github.com/certik/fortran-utils/.
> If authors of similar projects will do the same, then I think this
will be
> successful.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
>
<#104?email_source=notifications&email_token=AC4NA3OOAOETTGEXCWICS5LQX4R3LA5CNFSM4JSZ6FO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGNYNDQ#issuecomment-563840654>,
> or unsubscribe
>
<https://github.com/notifications/unsubscribe-auth/AC4NA3J4YD6FFB4OHEEKHILQX4R3LANCNFSM4JSZ6FOQ>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#104?email_source=notifications&email_token=AAAFAWATE3XOUV6UW332KIDQX4UXVA5CNFSM4JSZ6FO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGOAQAY#issuecomment-563873795>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAFAWA3OJHKS7HEMBQKIE3QX4UXVANCNFSM4JSZ6FOQ>.
|
Happy to! Will follow up with everybody later this week. |
On CMake: keep in mind that, depending on what goes into this standard library, it could be hundreds of modules with complex interdependencies. It might not be so easy to just pick and choose what you want to pull out. So, a good and modern build system will be critical. Like it or not, CMake is an option that a lot of people use. Once you get somebody that knows what they are doing to set it up, it is quite easy to use and add new stuff to. |
Yes but not all projects require that. Make is a standard solution and we
should minimize the amount of effort to set up a small project.
wt., 10 gru 2019, 17:05 użytkownik Jacob Williams <[email protected]>
napisał:
… On CMake: keep in mind that, depending on what goes into this standard
library, it could be hundreds of modules with complex interdependencies. It
might not be so easy to just pick and choose what you want to pull out. So,
a good and modern build system will be critical. Like it or not, CMake is
an option that a lot of people use. Once you get somebody that knows what
they are doing to set it up, it is quite easy to use and add new stuff to.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#104?email_source=notifications&email_token=AC4NA3N4E4XR7ENPPXRBEL3QX646PA5CNFSM4JSZ6FO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGPY2VY#issuecomment-564104535>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC4NA3KOIW6UPRIMDTSE6KDQX646PANCNFSM4JSZ6FOQ>
.
|
I don't like CMake either, but it will be important for cross-platform builds, especially as the project grows. Local CMake experts (ahem @jacobwilliams, @zbeekman?) will need to step up to the task to develop and maintain it. Another likely candidate is autotools. Many projects have 2 or more build systems in parallel. I agree overall that we should only add build capabilities as needed, rather than "maybe we'll need this someday". |
I see CMake as the best of a number of unpleasant alternatives. I use it because it allows me to support multiple platforms (Linux, Windows, OSX) with a single system, handle documentation generation, dependency management, testing, and packaging. Those may not be important in everyone's environment but they are in mine. CMake doesn't force me to alter my source code nor have I found it to affect resource consumption of the compiled artifacts (speed, size, memory consumption). I understand CMake is polarizing; maybe someone with experience with other systems can explain how one can repeatably and automatically build and test arbitrary code including dependency detection (and potentially retrieval and build) across multiple platforms without using a system like CMake. CMake is widely used, actively maintained, and has good support for Fortran. The syntax is weird and there's a learning curve, but I've found that to be true of every build system. Finally, as a community effort I'd hope that those of us with experience configuring build, documentation, and test infrastructure (I include myself in this) could assist in setting up these facilities for projects. I understand people not wanting to be bothered with CMake but I don't understand the resistance to having it available for those of us who need it. |
I never said it should not be available. What I say it that it should not
be required. Makefile is usually enough.
wt., 10 gru 2019, 18:53 użytkownik Bob Apthorpe <[email protected]>
napisał:
… I see CMake as the best of a number of unpleasant alternatives. I use it
because it allows me to support multiple platforms (Linux, Windows, OSX)
with a single system, handle documentation generation, dependency
management, testing, and packaging. Those may not be important in
everyone's environment but they are in mine. CMake doesn't force me to
alter my source code nor have I found it to affect resource consumption of
the compiled artifacts (speed, size, memory consumption).
I understand CMake is polarizing; maybe someone with experience with other
systems can explain how one can repeatably and automatically build and test
arbitrary code including dependency detection (and potentially retrieval
and build) across multiple platforms without using a system like CMake.
CMake is widely used, actively maintained, and has good support for
Fortran. The syntax is weird and there's a learning curve, but I've found
that to be true of every build system.
Finally, as a community effort I'd hope that those of us with experience
configuring build, documentation, and test infrastructure (I include myself
in this) could assist in setting up these facilities for projects. I
understand people not wanting to be bothered with CMake but I don't
understand the resistance to having it available for those of us who need
it.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#104?email_source=notifications&email_token=AC4NA3N5QIJQOIJLNZW2FHTQX7JP5A5CNFSM4JSZ6FO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGQEXII#issuecomment-564153249>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC4NA3NTG6DR3RVMMF5T7GLQX7JP5ANCNFSM4JSZ6FOQ>
.
|
@gronki Yes, I believe that is true of any CMake project. |
If the goals are to support all major OSes, then I would recommend CMake. Meson is coming along, but doesn't have as much buy in, and I don't know much about it. Also, CMake has pretty first class modern fortran support with automatic dependency resolution, and the ability to create robust install and export logic for package maintainers (i.e., debian, fedora, Homebrew, etc.) and can even output package-config pc files so that auto-tools packages can find it. A lot of the pain and hate with CMake stems from "bad" old-school CMake doing things in a weird/bad way, and just the fact that build systems & meta build systems are always a PITA. (I don't like CMake either, but I like it more than anything else I've tried to use in its place.) I have experience using CMake for Fortran mixed language (C and C++ too) projects that are required to build and run on all 3 major OSes, and use Microsoft Visual Studio for the main Fortran source on Windows. In addition, CMake has buy in at DOE, and many/most other national labs. I'd be happy to help out with CMake stuff.
Yes, don't build it before you need it is an important mantra to follow. Off topic
|
I found the following thread to be apropos of discussions here: https://twitter.com/MichaelCaisse/status/1204207152237367297?s=20 |
But Fortran is not C++. C++ was designed to be flexible and able to
accommodate any possible design structure in the code. Fortran is a rigid
and limited numerical computing language which is its advantage and cripple
at the same time. Look at all failed attempts to create any sensible
containers in Fortran as it is. They are ugly and unusable. You cannot do
it. Fortran needs standard library in 2 years or less. Generic will come in
no less in 10 years. In 15 years nobody will be left to write or use that
library. This is exactly the attitude that says "let this language die in
peace". It has to change.
wt., 10 gru 2019, 20:36 użytkownik Steve Lionel <[email protected]>
napisał:
… I found the following thread to be apropos of discussions here:
https://twitter.com/MichaelCaisse/status/1204207152237367297?s=20
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#104?email_source=notifications&email_token=AC4NA3KRJP36SWWJAPUSYZDQX7VTLA5CNFSM4JSZ6FO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGQSOHQ#issuecomment-564209438>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC4NA3N7P7BYJVW6PX2PGXLQX7VTLANCNFSM4JSZ6FOQ>
.
|
The real advantage of CMake is its ability to automatically resolve dependencies in modern Fortran. If we are going to have an even remotely complicated interdependencies within this library then I think CMake is a necessity and raw make files simply are not a viable option. As others have said, once someone has set up the CMake files, it is really not difficult to use. At work I was tasked with writing a sort of template/skeleton for new Fortran projects to use, part of which included a CMake build system. I think that would provide a more than adequate starting point and it would then be very easy to adapt for the needs of this project. |
I suggest let @milancurcic take the lead, setup a repository and we can discuss CMake and Makefiles in there. Let's use this issue to discuss what should actually be in the library. |
@zbeekman noted:
This is my feeling as well.
I'd add logging to that; I extended FLIBS' m_logger module with syslog-like priority but the stock module is quite usable as it is. There's a trend towards 'observability' vs unstructured logs in some sectors which might be interesting to look into, but simple logging is better than |
@apthorpe Thanks for the feedback. Yeah, logging is kind of the next feature on the list. I’m just so tired of FYI, the way I get overloading for all kinds of each intrinsic type is through the very awesome Jin2For package. A thin extension of Jinja2 that interrogates the compiler and provides nice convenience. Templating has its advantages for generic programming when used wisely and in moderation until there is something better in the standard. |
I created a repo here: https://github.com/fortran-lang/stdlib and bootstrapped some documents and issues. I will reach out directly to many of you over the next few days with some ideas and questions about getting more closely involved. |
Thanks @milancurcic for taking the lead on this. Let's start with something simple that we can all agree on, to learn and figure out how the process should work, and then we can try to tackle some of the more difficult proposals. It seems the least controversial will be a subset of NumPy and Matlab (both of which use very similar API):
And we just need to discuss the API (name, arguments, return value) and ensure it is familiar (identical or close to NumPy / Matlab / Julia, ...) and consistent with Fortran. |
I created fortran-lang/stdlib#10 for |
Sorry guys I lost this precious discussion and I read it only by now. I am willing to contribute to standard library. The project is open source and heavily influenced by my research activity, by older version of SciPy and by other similar projects (for which I got "inspired", e.g. some LAPACK interface from Certik's project :-)) Please feel free to use, copy, change, update, modify and whatever other action you may have in mind Scifor for the development of standard library. Scifor compiles with Cmake and try to make use of available lapack/blas/scalapack libraries present in the system (e.g. veclib, mkl, etc.): this is very important for optimisation and it is currently done also in the installation of scipy. Unfortunately there is essentially no documentation. (I am lazy I know).
I do have some additional comments, mostly based on my experience: Sorry for the very long message. |
@aamaricci thanks for the input! Let's keep the discussion going. I discovered your code and linked it at fortran-lang/stdlib#1 yesterday. I am I think in the same camp as you are --- for example with the modern Fortran Python like interface to Lapack implemented in fortran-utils, that you ended up using. I am glad you liked it! And I would like the whole of SciPy ported to Fortran, in a natural, non OO way. I have no doubts it would go a long way towards much wider adoption of Fortran. Furthermore, I want to ship this stdlib with LFortran, that would allow interactive usage in Jupyter, thus providing almost equivalent experience as SciPy (in fact I hope much better experience!). Others like @cmacmackin like OO interfaces, and I think we can have them too, in addition to non OO interfaces. The other aspect is that we pretty much know how to implement all of the above --- either we have already done that, or know how to do it quickly. The biggest contribution of then, once we mostly agree on the API, we merge into our "experimental" modules in master. You can see the PR 23 above for an example. Then much later, once we gain experience with the API, we will propose to move from experimental to main. The bar for that will be much higher. We are still figuring out all this workflow. But I am positive we can figure out a high quality process that would allow us to deliver on a Fortran Standard Library that we all eventually agree upon. |
As a counter argument to "make everything stdlib rather than part of the standard", here's an article: https://www.davidhaney.io/npm-left-pad-have-we-forgotten-how-to-program/ I think there's important quality in standarizing the behavior of the most essential utilities (such as string |
@gronki the goal of
We are obviously not there yet, as we have just started. These goals will take years to achieve. But if we achieve these (and probably there are more goals that we need to achieve beyond these) we might start calling The example you posted with Assuming we do achieve the above goals in the future, then it will be a good time to see if some of the |
I can't think of any procedure that should be considered for the standard and that shouldn't be staged and implemented in stdlib first. |
Just to add my two cents, my package Coretran contains some of the things discussed at the beginning of this issue. Its interfaced, object oriented, and uses submodules. There are things outside of scope of a standard library like KdTree and Shewchuks arbitrary precision geometry stuff (are these outside scope though?), but I do have a relatively fast introspection sort and dynamic arrays. I do use Cmake, but as @cmacmackin mentioned, I like how it handles the modern dependencies. I called my package Coretran because I did not want to suggest I was good enough to create a standard library! But that was the original intention I guess. I think contributing to a centralized 'approved' standard library is great! Im not saying use Coretran, im willing to migrate anything over if it makes sense. |
@leonfoks thank you for finding this project and getting in touch with us. I put a link to it into fortran-lang/stdlib#1, where we keep a list of similar and related projects. Indeed, many of us (myself included) have written similar libraries that were intended as a "standard library", see the full list at fortran-lang/stdlib#1. And none of us are good enough to create a standard library on our own. But the difference how (Update: we added the motivation into README: https://github.com/fortran-lang/stdlib#goals-and-motivation) Thank you for offering to migrate over things from Coretran. Would you mind following the workflow and get your things discussed and eventually implemented in |
Thanks @certik Looking forward to this project! I saw the update to fortran-lang/stdlib#1 . Its cool to see a list of the other projects too. I took a look at the workflow, I will start adding things and seeing what gets traction! |
@leonfoks do you want to start an issue for Coretran like I just did for my old library (fortran-lang/stdlib#103)? I think there are lots of open issues that parts of Coretran would fit into, and then you can open new issues for the rest. And let's get it discussed. |
Edit: Moved to https://github.com/fortran-lang/stdlib
I'm opening this meta issue with the goal of a broad and open-ended discussion around specific proposals that aim to add intrinsic procedures to the standard. Recent examples of such proposals are: #96, #100, #101, #103.
While I'm personally in support of most such proposals, I often see them as putting the cart before the horse. Why so? A common argument for such additions is that they are commonly used and often re-implemented over and over again because they're not available as intrinsics. I get this. However, if such intrinsics are really needed, I imagine there'd be an obvious choice of a 3rd party library available. Reusable and open libraries emerge when the pain is high enough in the community. That's how datetime-fortran came about. Lack of open source libraries may be a signal that there just isn't great need for such procedures.
Should we, as the Fortran community, consider working on a non-standard library that would include such procedures that we aim to the propose to the committee for inclusion in the standard? This library, or a subset of it, could over time become a candidate for the Fortran standard library, in addition to built-in intrinsics.
I foresee multiple benefits:
There are quite a few projects in this spirit, such as Arjen's flibs and Ondrej's fortran-utils. Such libraries could serve as design examples, and perhaps even contribute implementations toward a dedicated non-stdlib.
The text was updated successfully, but these errors were encountered: