stdlib
Optimization.jl
stdlib | Optimization.jl | |
---|---|---|
14 | 3 | |
981 | 674 | |
2.3% | 3.7% | |
9.6 | 9.7 | |
5 days ago | 2 days ago | |
Fortran | Julia | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
stdlib
-
SciPy: Interested in adopting PRIMA, but little appetite for more Fortran code
Hopefully, the SciPy community can stay open-minded about modern Fortran libraries.
Modern Fortran is quite different from Fortran 77, while being as powerful, if not more.
In addition, there has been a significant community effort on improving and modernising the legacy packages, the ecosystem, and the language itself.
With projects like LFortran (https://lfortran.org/), fpm (https://github.com/fortran-lang/fpm), and stdlib (https://github.com/fortran-lang/stdlib), I believe that Fortran will enjoy prosperity again.
-
Have you used Fortran for anything other than scientific programming? How is it, and how does it compare to other languages?
They're currently working on a Fortran standard library and it's pretty far along: https://github.com/fortran-lang/stdlib
-
Why Fortran?
I also like FPM and the ecosystem. In case anyone is just getting started with Fortran, definitely checkout the Fortran Standard Library project:
https://github.com/fortran-lang/stdlib
-
return value of get_command_argument() and allocatable 1D array
In general, it is necessary to know the length of a string in Fortran before using it. There is no general string with unspecified strength. Some libraries do provide such an object (e.g. Fortran Standard Library, but it is not available in the standard language. To obtain the length of the string in your example, you could use the length option in get_command_argument as integer :: clen character(len=:), allocatable :: string_b call get_command_argument(2, length=clen) allocate(string_b(clen)) string_b = '' call get_command_argument(2, string_b) write(*,*) string_b deallocate(string_b)
- Boost:Boost
-
A Modern Fortran Scientific Programming Ecosystem
If you need to clear memory in the local scope, you need to deallocate a variable explicitly. Otherwise, all Fortran variables are cleared automatically when they go out of scope. One exception are Fortran pointers (different from C pointers) which are discouraged unless really necessary. We have a discussion for a high-level wrapper for files here: https://github.com/fortran-lang/stdlib/issues/14. So, it's in scope we just haven't gotten far with the design and implementation.
-
"The State of Fortran" -- accepted for publication in Computing in Science and Engineering
FYPP syntax is ugly, but is the best tool available for now to build the Fortran stdlib. People do not have to use the FYPP version of stdlib. There is also a clean post-processed version of the stdlib completely free of FYPP or any other FPP, which looks great: https://github.com/fortran-lang/stdlib/tree/stdlib-fpm
-
Cube-root and my dissent into madness
What if we try to evaluate this using standard-compliant Fortran? Interestingly, this is an open issue in the fortran-lang/stdlib project. f90 real(8) function f(x) real(8) :: x f = x**(1d0/3d0) endfunction I know real(8) isn't standard compliant but fixing that for this tiny example would be a headache. Then, compiling with -O3 gets us f_: movsd xmm1, QWORD PTR .LC0[rip] movsd xmm0, QWORD PTR [rdi] jmp pow .LC0: .long 1431655765 .long 1070945621
-
Learning Functional programming. Which languages to learn.
learn Fortran (supports both FP and OO, but when we say Fortran we think FP mostly). And the best way to learn is contributing. You can checkout their GitHub org (Fortran-lang) and you might be astonished to see that you too can make contributions there. But you should be ready to learn and search things on your own as well. They have a discourse group too, if you get stuck somewhere. Good luck. At the moment of writing this post they have a good first issue (Greatest Common Divisor) on their stdlib repo.
-
Fortran Web Framework
I recently started learning Fortran for a lark. It reminds me a lot of R, in some respects. It's clearly a very, very good language for doing the parts of one's job that are very math-centric. But it's equally underwhelming as a general purpose programming language.
Largely, I think, due to gaps in the library ecosystem. But there are other challenges. You can see from the install instructions on the linked page, for example, that Fortran still lacks a package manager.
What's interesting, though, is that that's changing. There are currently serious efforts to give it a "standard" library (https://github.com/fortran-lang/stdlib) and package manager (https://github.com/fortran-lang/fpm).
And I've been watching the new LFortran compiler (https://lfortran.org) with extreme interest.
Optimization.jl
-
SciPy: Interested in adopting PRIMA, but little appetite for more Fortran code
Interesting response. I develop the Julia SciML organization https://sciml.ai/ and we'd be more than happy to work with you to get wrappers for PRIMA into Optimization.jl's general interface (https://docs.sciml.ai/Optimization/stable/). Please get in touch and we can figure out how to set this all up. I personally would be curious to try this out and do some benchmarks against nlopt methods.
-
Help me to choose an optimization framework for my problem
There are also Optimization and Nonconvex , which seem like umbrella packages and I am not sure what methods to use inside these packages. Any help on these?
-
The Julia language has a number of correctness flaws
> but would you say most packages follow or enforce SemVer?
The package ecosystem pretty much requires SemVer. If you just say `PackageX = "1"` inside of a Project.toml [compat], then it will assume SemVer, i.e. any version 1.x is non-breaking an thus allowed, but not version 2. Some (but very few) packages do `PackageX = ">=1"`, so you could say Julia doesn't force SemVar (because a package can say that it explicitly believes it's compatible with all future versions), but of course that's nonsense and there will always be some bad actors around. So then:
> Would enforcing a stricter dependency graph fix some of the foot guns of using packages or would that limit composability of packages too much?
That's not the issue. As above, the dependency graphs are very strict. The issue is always at the periphery (for any package ecosystem really). In Julia, one thing that can amplify it is the fact that Requires.jl, the hacky conditional dependency system that is very not recommended for many reasons, cannot specify version requirements on conditional dependencies. I find this to be the root cause of most issues in the "flow" of the package development ecosystem. Most packages are okay, but then oh, I don't want to depend on CUDA for this feature, so a little bit of Requires.jl here, and oh let me do a small hack for OffSetArrays. And now these little hacky features on the edge are both less tested and not well versioned.
Thankfully there's a better way to do it by using multi-package repositories with subpackages. For example, https://github.com/SciML/GalacticOptim.jl is a global interface for lots of different optimization libraries, and you can see all of the different subpackages here https://github.com/SciML/GalacticOptim.jl/tree/master/lib. This lets there be a GalacticOptim and then a GalacticBBO package, each with versioning, but with tests being different while allowing easy co-development of the parts. Very few packages in the Julia ecosystem actually use this (I only know of one other package in Julia making use of this) because the tooling only recently was able to support it, but this is how a lot of packages should be going.
The upside too is that Requires.jl optional dependency handling is by far and away the main source of loading time issues in Julia (because it blocks precompilation in many ways). So it's really killing two birds with one stone: decreasing package load times by about 99% (that's not even a joke, it's the huge majority of the time for most packages which are not StaticArrays.jl) while making version dependencies stricter. And now you know what I'm doing this week and what the next blog post will be on haha.
What are some alternatives?
Fortran-code-on-GitHub - Directory of Fortran codes on GitHub, arranged by topic
StatsBase.jl - Basic statistics for Julia
fpm - Fortran Package Manager (fpm)
Petalisp - Elegant High Performance Computing
MYSTRAN - MYSTRAN is a general purpose finite element analysis solver
OffsetArrays.jl - Fortran-like arrays with arbitrary, zero or negative starting indices.
fortran-lang.org - (deprecated) Fortran website
avm - Efficient and expressive arrayed vector math library with multi-threading and CUDA support in Common Lisp.
neural-fortran - A parallel framework for deep learning
Distributions.jl - A Julia package for probability distributions and associated functions.
pyplot-fortran - For generating plots from Fortran using Python's matplotlib.pyplot 📈
StaticLint.jl - Static Code Analysis for Julia