On 7/24/18 1:14 PM, Dominik Gronkiewicz wrote:
> Having read some of the messages in this thread that defend the language ambiguity and leaving the responsibility on the users, rather than just keeping the rules simple and predictable, I have trouble understanding the fear from change for better.
I have trouble understanding your trouble. Several people have explained
fairly clearly their opinions. You can agree or disagree, but I don't
understand your point.
> If the standard was consistent, this code would never compile, because either functions with side effects would not be allowed (this is the job of subroutines), or function evaluation would be predictable (as in C/C++).
If you want expressions with multiple function calls to short circuit,
then you can write the code that way (with nested loops). If you want
those expressions to always evaluate all function references, then you
can write the code that way (separate statements). And if you want to
let the compiler have a chance to optimize away as much as it can, then
you can write the code that way.
> But then old good "that would not be Fortran anymore" argument comes up because "it worked like that since FORTRAN compiler for mechanical calculator in 1932 so we should not change it". What is the Fortran way anyway? I see the Fortran philosophy as "code clear, compute fast, save time on debugging".
And backwards compatibility. Few other languages can compile code from
five decades ago with modern compilers and modern language standards.
> If this philosophy will kill some old unmaintained code -- so be it, programming language is not a museum and nobody should cry.
That is your opinion. Others have different opinions on this.
> However, some seem to favor another philosophy: "keep the language broken and allow sh*tty programming habits because it worked 40 years ago and I don't want to learn proper modern programming". I cannot disagree enough with this approach. Standard should never allow dubious code to exist and compile. Nobody likes the change (nor do I), but the role of the standard is to gently encourage users to adapt by deleting bad features. Fortran with its declining popularity, slow development and tiny amount of available libraries (as compared to C/C++ or Python) has little chance of survival if it doesn't win new programmers with other features, such as ease, clarity, flexibility for optimizations and preventing errors.
Generally the fortran approach is to introduce new features to the
language that allow various advantages, while maintaining as much as
possible backward compatibility.
> I think there's no doubt Fortran is way behind its competitors in many ways,
And there is no doubt that it is ahead of its competitors in many ways
too. For a simple example, one could specify lower and upper bounds in
arrays in f77. I use that feature daily, almost every time I write a
fortran code. Many other languages still do not allow that, and that
feature is from 40 years ago.
> and its good sides can barely make up for it. I am afraid if the mindset doesn't change, it will stay behind for a long time, before its ultimate death.
I also worry about the survival of the language, but my opinion about
its problems are different from yours.
1) It should be easy to read and write spreadsheet files. This should
have been done in the 80s when visicalc and excel and other spreadsheets
became popular. Maybe this should be extended to database access too.
2) There should be a bit data type that allows arbitrary strings of bits
to be processed. This should have been done in the 80s when image
processing and computer typesetting became popular.
3) It should be easy to plot graphs to a screen. This should have been
done in the 80s when MacOS, Xwindows, and other graphical interfaces
became popular.
4) It should be easy to display 3D animations (molecules reacting, fluid
flow, galaxies colliding, virtual reality, etc.). This should have been
done in the 90s.
5) It should be easy to read an array of unknown length. This should
have been added to the language when allocatable arrays were introduced
in f90.
6) It should be easy to query to see the amount of memory allocated, and
when appropriate, the amount of memory available for future allocations.
This should have been a feature of f90 when allocatable and automatic
arrays were introduced to the language.
Those are some items off the top of my head. I'm sure I could think of a
few more with a little effort.
$.02 -Ron Shepard