Click here to Skip to main content
15,887,027 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: A Fortran question Pin
trønderen23-Feb-23 13:03
trønderen23-Feb-23 13:03 
GeneralRe: A Fortran question Pin
jmaida23-Feb-23 18:11
jmaida23-Feb-23 18:11 
GeneralRe: A Fortran question Pin
jsc4224-Feb-23 0:16
professionaljsc4224-Feb-23 0:16 
GeneralRe: A Fortran question Pin
trønderen24-Feb-23 0:57
trønderen24-Feb-23 0:57 
GeneralRe: A Fortran question Pin
jsc4224-Feb-23 5:05
professionaljsc4224-Feb-23 5:05 
GeneralRe: A Fortran question Pin
trønderen24-Feb-23 6:04
trønderen24-Feb-23 6:04 
GeneralRe: A Fortran question Pin
giulicard24-Feb-23 5:36
giulicard24-Feb-23 5:36 
GeneralRe: A Fortran question Pin
trønderen24-Feb-23 8:38
trønderen24-Feb-23 8:38 
giulicard wrote:
Moreover, since it should not be able to allow (memory) aliasing (since it does not have pointers),
Being around 40 years since I coded Fortran, I have forgotten a lot Smile | :) , such as the parameter transfer mechanism. The standard mechanism was call by reference, wasn't it? If a subroutine assigned a value to a formal parameter, the value of the actual parameter would be changed.

A reference parameter is equivalent to a pointer. So if you pass the same actual parameter for two formal parameters, you have an aliasing issue. E.g. if the compiler reorders the assignments to the two formal parameters, it might affect the final value of the actual parameter. If some COMMON block variable is used as parameter, and the subroutine refers to the same COMMON variable, you have a similar aliasing issue.

In my study years, Pascal was quite new. It didn't become the language for the Introduction to Programming course until the year after I started my studies (and then only for half of the students), so pointers were definitely 'something new'. Yet, in the Compilers course, aliasing issues certainly had a prominent place. Aliasing was treated as exceptional situations; it wasn't something you would worry too much about in Fortran.

Even with Pascal and its strongly typed pointers, aliasing wasn't that essential - if the compiler didn't do much optimizing (which was often the case for Pascal compilers), the compiler could play back a 'You asked for it, you got it!' if a programmer referenced the same location along two different paths. Hell didn't break loose until C came with void*, pointer arithmetic, more or less arbitrary casting, and pointers to non-heap locations. Today, we have the processing power and memory capacity to do a more or less complete flow analysis of the compilation unit; in the K&R days, you couldn't expect that. I suspect that compilers were quite fast to conclude, when they encountered a void* or an arbitrary cast, "Oh well, we'll just have to drop all optimization of this one!"
GeneralRe: A Fortran question Pin
giulicard25-Feb-23 0:10
giulicard25-Feb-23 0:10 
GeneralRe: A Fortran question Pin
FreedMalloc23-Feb-23 16:37
FreedMalloc23-Feb-23 16:37 
GeneralRe: A Fortran question Pin
Matthew Wilson24-Feb-23 4:44
Matthew Wilson24-Feb-23 4:44 
GeneralRe: A Fortran question Pin
Bruce Patin24-Feb-23 4:58
Bruce Patin24-Feb-23 4:58 
GeneralRe: A Fortran question Pin
Mike Johnston24-Feb-23 5:35
professionalMike Johnston24-Feb-23 5:35 
GeneralRe: A Fortran question Pin
Cpichols24-Feb-23 5:56
Cpichols24-Feb-23 5:56 
GeneralRe: A Fortran question Pin
Igor Pankovcin24-Feb-23 8:10
Igor Pankovcin24-Feb-23 8:10 
GeneralRe: A Fortran question Pin
Roger House24-Feb-23 12:31
Roger House24-Feb-23 12:31 
GeneralRe: A Fortran question Pin
D Scott Baeder24-Feb-23 17:52
D Scott Baeder24-Feb-23 17:52 
GeneralRe: A Fortran question Pin
Southmountain25-Feb-23 3:45
Southmountain25-Feb-23 3:45 
GeneralJOTD Pin
Jacquers23-Feb-23 5:40
Jacquers23-Feb-23 5:40 
GeneralRe: JOTD Pin
PIEBALDconsult23-Feb-23 6:43
mvePIEBALDconsult23-Feb-23 6:43 
GeneralRe: JOTD Pin
Eddy Vluggen23-Feb-23 7:10
professionalEddy Vluggen23-Feb-23 7:10 
GeneralRe: JOTD Pin
Marc Clifton23-Feb-23 9:31
mvaMarc Clifton23-Feb-23 9:31 
GeneralBut of course... Pin
Kornfeld Eliyahu Peter22-Feb-23 23:26
professionalKornfeld Eliyahu Peter22-Feb-23 23:26 
GeneralRe: But of course... Pin
RickZeeland23-Feb-23 0:39
mveRickZeeland23-Feb-23 0:39 
GeneralCCC 23-02-2023 Pin
pkfox22-Feb-23 21:28
professionalpkfox22-Feb-23 21:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.