3 ms·
Never or ever? I have to use it for a work project. It's ok when dealing with numbers or matrices, but very painful in many respects. It's missing quite a few f
by xioxox 5y ago
Never or ever? I have to use it for a work project. It's ok when dealing with numbers or matrices, but very painful in many respects. It's missing quite a few features found in more recent languages. I don't recommend it personally unless you're working with other big fortran codes.
* Missing standard data structures, like hash maps. I just wish I had something like a Python dictionary built in.
* Strings are pretty awful. You can now have resizeable strings but using them is very painful (and buggy in gfortran). You'll have to constantly strip spaces off the ends of strings to even print them.
* Some of the compilers are very immature (gfortran), if using any fairly recent features (e.g. resizeable strings). I've hit several (still unfixed) compiler bugs and my code contains some terrible workarounds.
* Available libraries are hit and miss, particularly outside the numerical area.
* Linking to C/C++ is possible, but painful with the binding support.
* Documentation (including books) just isn't good compared to what's available for C/C++/Python, etc.
* No templates (would come in very handy for some routines which handle different numerical types).
* Ok for numerics, though can't use C/C++ intrinsics for AVX/SSE maths.
I suppose what I like better than C/C++ is the module system and built-in support for N dimensional arrays with proper slicing, etc. The allocatable array thing is quite nice - it's like smart pointers in C++.
- certik 5y agoThank you. I agree with all of this, and that is precisely the reason why I decided to get involved to make things better. To fix all of the above I believe we need: * Much better tooling and more organized community, thus we started https://fortran-lang.org/ https://fortran-lang.org/ and the associated projects (fpm, stdlib, ...) and discussion board (Discourse) * Better compiler that has good support for all Fortran features, and can help with linking and using C++ and Python libraries (automatic wrappers both ways), better optional warnings (to prevent old style code), good support for GPUs, etc. Also interactive like Python or Julia. I started LFortran (https://lfortran.org https://lfortran.org) to fix that. * Perhaps some improvements to the language (I joined the Standards Committee and I encourage people to join). We have a subgroup for generics (templates). The hash maps should probably go to stdlib first, later we can think about putting them into the language itself.