13 ms·
Fortran Package Manager
- tomcam 6y agoFortran has one. But not C. What hath God wrought.
- jcelerier 6y agoC and c++ have a ton. Vcpkg, cpm, conan, hunter ...
- jhgb 6y agoWell, in "Fortran has one. But not C", "not C" can be interpreted as "The number of these for C is different from 1". ;)
- 174SIGSEGV 6y agoWell, in FORTRAN, GOD is REAL (and JESUS is INTEGER, but that's not as funny). Even modern fortran has to maintain this feature for legacy reasons, leading one to add 'implicit none' to the beginning of each module etc.
- jabl 6y ago> in FORTRAN, GOD is REAL .. but not COMPLEX nor LOGICAL
- aarchi 6y agoFortran has a lot of interesting current compiler work leveraging MLIR, a subproject of LLVM: Flang [0] and CIL for C/C++/Fortran [1]. It seems like Fortran tooling is making somewhat of a comeback. [0]: https://github.com/llvm/llvm-project/tree/main/flang https://github.com/llvm/llvm-project/tree/main/flang [1]: https://llvm.org/devmtg/2020-09/slides/CIL_Common_MLIR_Abstraction.pdf https://llvm.org/devmtg/2020-09/slides/CIL_Common_MLIR_Abstr...
- KMag 6y ago"I don't know what the language of the year 2000 will look like, but I know it will be called Fortran." —Tony Hoare
- nicklecompte 6y agoI have seen this quote thrown around a lot and have never had the proper context to understand what Hoare was getting at. The quote is from 1982[1], which seems a bit too late for any “Fortran juggernaut” jokes to have been relevant, and even in 1982 I would have guessed that Fortran was considered a bit old-fashioned. Was he commenting on its comparatively simple design, compared to “flashier” languages like Pascal? Was he just noting its ubiquity in science / government work? Or was Fortran at the time considered a buzzword, something cool-sounding to rope ignorant managers into approving tech projects? I am a Young Person (thirties) so this era of computing is before my time. More to the point, Hoare’s statement was a deliberately squishy social comment and not a rigorous computer-science comment, which makes it harder for outsiders to “objectively” understand his point. I just can’t see a way that Fortran really fits in the comment - what was the punchline supposed to be? [1] https://arstechnica.com/science/2014/05/scientific-computings-future-can-any-coding-language-top-a-1950s-behemoth/ https://arstechnica.com/science/2014/05/scientific-computing...
- bdavis__ 6y agoIn 1982, FORTRAN use was widespread. The limitations of the language were well known, and it was "obvious to all" that the languages of the future would be more sophisticated and overall "better" than FORTRAN. It was not "cool", but very mainstream. Taught to all engineering majors in college. And it was the go to language when COBOL wasn't a match. I interpret this statement as pointing at the tremendous inertia against change, and the fact that most of the tasks given to the computer do not require a abstraction and advanced concepts; just the "IF THEN", "DO", and assignment. I think he was off by 10 years. Even now "You can write FORTRAN in any language". I have seen javascript done this way. And it works. We can argue about how well, but it works.
- volta83 6y agoThis is... built using Fortran, NICE. Writing a TOML parser in Fortran is precisely my definition of FUN.
- exdsq 6y agoFUN == FU*ing Nightmare? ;)
- sdfhbdf 6y agoAnd it was built in Haskell in the first version. https://github.com/fortran-lang/fpm/pull/420 https://github.com/fortran-lang/fpm/pull/420
- certik 6y agoThe first version was actually in Rust, then Haskell and finally in Fortran.
- philshem 6y agothis is the code for the TOML parser https://github.com/fortran-lang/fpm/blob/master/src/fpm/toml.f90 https://github.com/fortran-lang/fpm/blob/master/src/fpm/toml... which seems to use another package https://toml-f.github.io/toml-f/ https://toml-f.github.io/toml-f/
- certik 6y agoIt sounded like a crazy idea at first, but then we discussed it and realized this is exactly what we should do. It makes perfect sense.
- Cerebrum1234 6y agoA single Fortan
- mxcrossb 6y agoI think I would prefer a separation between the package manager and build system. I’ve already got a build system for my FORTRAN codes, and that system can handle all the complications. SPACK, for example, can easily work with a pre-existing build system. But I definitely think that the worst part of FORTRAN compared to modern languages is that it takes so much work to manage external dependencies, so I appreciate the effort.
- certik 6y agoThis issue of separating a build system and a package manager vs lumping it together is a key design decision. We chose to follow Rust's Cargo, which lumps it together. It seems like a wrong decision at first (for the reason you stated), but we feel it is actually the right decision: from the user experience it feels much more natural and robust. I was not sure at first, but after playing with Cargo and Rust, you realize that this is the way to go.
- mraza007 6y agoJust curious is Fotran Still being used in Newer Projects
- dionhaefner 6y agoYes. Fortran is used extensively in climate modelling (even newer models).
- mraza007 6y agoReally that’s interesting, just curious fortran over other languages
- chriswarbo 6y agoThe intuition is similar to "why C over other languages?": speed. Many programmers treat C as the fastest/lowest-level cross-platform language, but Fortran sometimes has a slight edge (especially with specialised compilers, e.g. I remember Intel's producing very fast binaries). Although it's general-purpose, Fortran skews heavily towards numerical calculations, which is probably why it's not used much outside science and engineering (e.g. most Web stuff is 'string processing' rather than numerical). Fortran was used to write highly optimised numerical libraries like BLAS, which are so widely used and performance-critical that it pretty much cemented Fortran's use; although (a) such libraries can be used by other languages, and (b) they've become so optimised over the decades that they're essentially pure machine-code these days ;)
- gspr 6y agoBut interfacing with Fortran from other languages is easy (well, barring some compiler assumptions that everyone seems to be making anyway). Why not leverage the general purpose strength of languages like Rust or C++ or Python (or even C), while still retaining access to the vast trove of numerical Fortran libraries? (Not that I'm judging, people should use whatever language they prefer).
- cik 6y agoI rely on FPM the Effing Package manager[0]. Occasionally, I run into php-fpm [1]. There's an unfortunate naming collision, at least with the first. [0]: https://github.com/jordansissel/fpm https://github.com/jordansissel/fpm [1]: https://www.php.net/manual/en/install.fpm.php https://www.php.net/manual/en/install.fpm.php
- milancurcic 6y agoWe asked for and received a blessing from Jordan: https://github.com/fortran-lang/fpm/issues/90 https://github.com/fortran-lang/fpm/issues/90
- cik 6y agoI mean that's great - but I don't think it's necessary, it's a name not a trademark. I was trying to point out that its unfortunate when names collide.
- oblio 6y agoFor folks who have never used Fortran, how is the day to day life compared to Python or Java?
- omrjml 6y agoIt depends on what you are doing. If it is numerical work with matrix operations, then Fortran is fast and pretty intuitive. Some of the annoyances come from dealing with legacy code and mixing it with modern standards.
- Mauricebranagh 6y agoAlso Compared to Python Fortran is an old school compiled language - you have to get used to working with a compline/link cycle without the interactivity that Python has. This isn't any better or worse but does require a shift in mind set. Though I believe some people are trying to build a Fortan Repl
- omrjml 6y agoThat's true, I keep forgetting about https://lfortran.org/ https://lfortran.org/ Unfortunately in my experience the people I know who almost exclusively code in fortran are not really interested in jupyter notebooks.
- certik 6y agoIndeed, I expect it will be newcomers to Fortran from languages like Python, Julia or Matlab who will really like LFortran once it matures. We are working very hard on it and are close to compiling real world projects, you can follow our progress on MVP here: https://gitlab.com/lfortran/lfortran/-/issues/313 https://gitlab.com/lfortran/lfortran/-/issues/313 Current Fortran programmers might not always appreciate the interactive part, but I think they will also like LFortran as another independent compiler and for some of its features once it matures (such as C++ translation, fast compilation, good warnings, automatic wrappers to/from Python, etc.).
- 6y ago
- shoo 6y agohere are some articles by some of the contributors: Fortran Package Manager's First Birthday (2020-12?): https://github.com/everythingfunctional/fortran-forum-fpm-first-year/blob/main/doc/paper/part-00.md https://github.com/everythingfunctional/fortran-forum-fpm-fi... It was very quickly that many interested in using fpm also expressed some interest in helping with its development. There was one problem. Most people were not familiar with Haskell, making that a significant barrier to their being able to contribute. But everybody had significant experience (or at least interest) in Fortran. It was thus that we decided we would rewrite fpm in Fortran, enabling a larger portion of its intended users to also be contributors. With the initial prototype usable for developing libraries, and many already converting their existing libraries to be fpm compatible, it didn’t seem quite so daunting a task as it otherwise would have. Resurrecting Fortran (2021-03): https://ondrejcertik.com/blog/2021/03/resurrecting-fortran/ https://ondrejcertik.com/blog/2021/03/resurrecting-fortran/ First year of Fortran-Lang (2020-12): https://medium.com/modern-fortran/first-year-of-fortran-lang-d8796bfa0067 https://medium.com/modern-fortran/first-year-of-fortran-lang...
- Decabytes 6y agoThis is really cool. There are definitely problems with security when it comes to package managers, but I think it has become apparent that having a dedicated package manager for your language is almost as important as the language features your language offers. As a side note. I've never used Fortran, but I see it around from time to time (R & Python packages that have fortran dependencies). Is Fortran seeing a bit of a resurgence? Is there any reason to use Fortran over say C, C++, Rust, or some other language? Or is it simply down to Fortran's maturity providing robust libraries in certain areas that other languages haven't?
- andi999 6y agoMatrix Fortran code can be faster (due to more information for the compiler)
- trianglesphere 6y agoIt seems like there's a small resurgence. You'd use fortan over those other languages for scientific computing. It's built for number crunching. As so it has some language features that help, has been optimized for it (see the n-body problem benchmark), and a lot of the number curnching libraries are written in it. One example of a project that I've used (but didn't work on) is GEMINI which is a newish prokect written in modern fortan. https://github.com/gemini3d/gemini3d https://github.com/gemini3d/gemini3d
- trianglesphere 6y agohuh, ifort is slower than I remember compared other langs/impls: https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/fortran.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- certik 6y agoI don't know what exactly is going on, but last time I looked into it, it seemed the main difference between the codes was how quickly you can do 1/sqrt(x). Ultimately, I would like to see more numerical benchmarks and also compare more versions in a given language. We started a repository for it: https://github.com/fortran-lang/benchmarks/ https://github.com/fortran-lang/benchmarks/ But didn't have time to work on it yet. See the issues, e.g., at: https://github.com/fortran-lang/benchmarks/issues/2 https://github.com/fortran-lang/benchmarks/issues/2 For some discussion how to best do that.
- the_only_law 6y agoIs there any value in learning Fortran today, regardless if you work in a domain where it’s a thing or now? From seeing a lot of job postings in the sort of domains one would expect it to be used(scientific stuff and similar “academic” and research fields) it seems like Python and maybe Julia has taken over for most stuff and Fortran requirements are written as if it’s a “nice to have” for any legacy maintenance.
- abzug 6y agoA bunch of scientific libraries in Python and Julia are wrappers for really fast stuff made in Fortran, C/C++ so...
- oscardssmith 6y agoBLAS/LApack are pretty much the only Fortran libraries that Julia uses afaik. There is also in development work on a Julia only blas replacement (Octavian.jl) which is competitive with mkl for the basic gemm already (more work needed for some of the more obscure functions). Lots of the push behind Julia is for it's ability to let fairly simple code compete with hands optimized Fortran.
- dagw 6y agoIf you work in a 'number crunching' domain it's worth learning enough Fortran to be able to read it. You'll at some point probably have to look at some Fortran code and try understand how it works (or doesn't work). However the chances that you'll be called upon to write new Fortran is tiny.