forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Not Clear diagnostics
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Mon Sep 16, 2019 5:09 am    Post subject: Re: Reply with quote

Dan, you and I have a handicap. When we see a compiler error message that we cannot make sense of, we look at the line in the source code that is causing the error; we usually know what we wanted to say in that line of code, but the compiler does not. The compiler and we humans differ greatly in the amount of context that we are able to include in our reasoning.

Quote:
Novices will not stick with Fortran with such diagnostics messages

Novices will have to be patient and get help and advice as needed, as with learning to ride a bicycle. You can make things "as easy as falling off a horse", but the novice will still need to procure a horse and seek help to get on the horse before reaching the goal of falling off, and have a backup plan for what to do after reaching the goal.

Dan, do me a favor. Look at the commands and the corresponding error messages from the Unix shell, in the collection at https://www.gnu.org/fun/jokes/unix.errors.html . After you finish laughing, for at least a few of the cases, (i) try to explain why the program (the sh/bash shell) gave the responses that it did and (ii) give your own novice-friendly answer.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sat Sep 21, 2019 11:18 am    Post subject: Reply with quote

That link was fun but the fact i spent today one hour swearing was definitely not. Same error - spurious symbol in the name of array subscripts and the FTN95 again tricked me into its typical anti-user snobism about "automatic arrays" or their not "explicit shape" because as we now know the developers do not use their own Fortran compiler heavily and the users do not report any suggestions for improvements

Code:

0531) COMMON /ExpD_/ CaptionExp1(nMaxFiles_Exp),&
0532) &  CaptionExp1Displ, &
0533) &  Xg_Exp(idimExpDat0,nMaxFiles_Exp), &
0534) &  Yg_Exp(idimExpDatO,nMaxFiles_Exp)

*** Error 477: The DIMENSION specification for variable YG_EXP is not an
    explicit shape
*** Error 897: YG_EXP cannot be used as an automatic array as it is in a
    COMMON block


Fine, let this wording stays but adding "Did you possibly forget to set array subscript idimExpDatO?" would help better like FTN95 sometimes doing with other cases
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Sat Sep 21, 2019 11:57 am    Post subject: Reply with quote

You left out the declarations of the types of the variables in the common block and the types and attributes of the array extents such as nMaxFiles_Exp. Those quantities would usually be integers with the parameter attribute, or dummy arguments.

Without that information, I am unable to comment on what the compiler said. Usually, when a compiler gives many messages that do not make sense, it is also true that the code that you gave to the compiler does not make sense to the compiler, at least by itself.

I tried the compiler on these lines from The Tale of Two Cities

Code:
It was the best of times, it was the worst of times
It was the age of wisdom, it was the age of foolishness
It was the epoch of belief, it was the epoch of incredulity


and it said

Code:
[FTN95/Win32 Ver. 8.51.0 Copyright (c) Silverfrost Ltd 1993-2019]
0001) It was the best of times, it was the worst of times
*** Statement not recognised
0002) It was the age of wisdom, it was the age of foolishness
*** Statement not recognised
0003) It was the epoch of belief, it was the epoch of incredulity
*** Statement not recognised
*** Missing END statement
    4 ERRORS  [<main program> FTN95 v8.51.0]
*** Compilation failed


What would you have expected from the compiler in this case?


Last edited by mecej4 on Sat Sep 21, 2019 1:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Sat Sep 21, 2019 1:00 pm    Post subject: Reply with quote

Dan,

From what you have posted, I would expect that idimExpDat0 and nMaxFiles_Exp are not integer parameters.
If the compiler is issuing so many error/warnings then I doubt if the definition of these parameters is available.
Also, why is the compiler suggesting YG_EXP is an automatic array ? must be in code not listed.

A safe approach is to define the COMMON /ExpD_/ in an include file, where the array dimensions are clearly provided as parameters.

At a minimum, you should be using implicit none or /IMplicit_none, rather than complain about the compiler messages.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Sat Sep 21, 2019 1:12 pm    Post subject: Reply with quote

Mecej4,

On the grounds that the compiler is expected to have mind-reading capabilities, perhaps it should have said that a continuation was required between lines 1 and 2, and again between lines 2 and 3; that lines 2 and 3 shouldn't have been capitalised, commas were missing, and so was the rest of the sentence!

Then again, it perhaps should have known the name of the Author, and remarked that the bulk of the program was missing ...

And on the subject of The Tale, I see that dear old Charles (after all, England is so small in the eyes of our transatlantic cousins that we all know each other, and are on first name terms) is excessively formal, as I know Mrs Southcott (a few lines on) as Joanna, although I have never examined her famed box (I'm not a Bishop).

And indeed, having successfully compiled and run, perhaps Clearwin+ in the embrace of both Windows and FTN95, should, instead of a FORTRAN STOP, present a window, in which one might read:

Quote:
“It is a far, far better thing that I do, than I have ever done; it is a far, far better rest that I go to than I have ever known.”


... with a button marked 'OK'.

Eddie
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Sat Sep 21, 2019 1:31 pm    Post subject: Reply with quote

Eddie, make the button say "OK, or Not OK?", because that is more often what is meant. It is not your agreement with the conclusion "OK" that is sought, just your permission to terminate the misbehaving program.
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sun Sep 22, 2019 4:37 am    Post subject: Reply with quote

As i wrote several times that 21 century compilers have to have the next level of suggestions besides the ultrashort ones they give today. They have to start learning from the experience compiling this code for 1000000 times in 40 years.

People will not notice, like my example just showed above that idimExpDatO and idimExpDat0 are not the same but compiler will distinguish them immediately.

Besides this is the common block and compiler can get additional info from same common block in other place and in this case tell almost for sure that the index idimExpDatO is not defined because of typo O instead of 0. So it will guess more precisely. If it will be wrong - like with mecej4 funny extreme examples, i will learn from that too and do not judge it too strongly. You are laughing, but eventually in the lifetime of already current generation the artificial intelligence will laugh on us humans even more.

In the case all you missed i already saw first indications of implementation of what i am saying, so it is not new. I saw that FTN95 in some cases tells "Have you forgot to ... ?" or something like that. I want this to continue introducing the key with different levels of /verbose_compilation. Compilers should babysit their users.

As to John's "implicit none" - thank you, but no, i will not use it, i already responded on that. I will find the error like above eventually and will find it even much faster in the future if compiler will help me more. But i will not find the subtle rounding error, or wrong indexing error or tricky accuracy error in a lifetime with "implicit none" if i will think that some variable idimDoSomething is integer but it actually is real or vice versa. Experience shows that I have no time, and no one else has it, to search the long list of declarations of variables which was grown to the size of phonebook of a decent size village - are these variables real or integer


Last edited by DanRRight on Sun Sep 22, 2019 10:25 am; edited 3 times in total
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Sun Sep 22, 2019 5:53 am    Post subject: Reply with quote

Dan,

Having some experience with modest AI approaches, there is no API wrapper to include "/verbose_compilation" as part of the clearwin+ approach for FTN95 to include new AI capability.
Microsoft does not appear to have this in their library and as to the friendliness of the MSDN, I don't think they have a good history.

It is interesting to suggest that the compiler should learn from our history of use. Not sure how Paul would add this to the wish list.

That said, you do raise some interesting ideas for how compilers should evolve.

John
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Sun Sep 22, 2019 10:55 am    Post subject: Reply with quote

Mecej4,

There's no point in taking the frivolous seriously. If one did, then 'OK' is not a good response, as it so often is not in a real Window, and the guidance from Microsoft tells us to use an action word. In the interests of brevity, I didn't list all the options, including 'Post a note on the forum', with options to select 'Use language intended to provoke', 'Adduce satanic involvement', and so on.

In a more serious vein, Dan, your variable ending in 0 or O is something that one should avoid, because it is well-known that these two characters are often typed mistakenly - not, I might add, because they look the same, but because they are close together on the keyboard. The error is not detected because they look the same. The answer is usually to use base 1 not base 0, although with the wrong font I or l might look like 1, but at least those characters are well-separated on the keyboard. Also, 'camel case' does not separate letters and numerals as well as the underscore does, so it is much more likely that you catch the problem yourself with idimExpDat_0 than with idimExpDat0. Just a hint.

My other finger-trouble is with comma and full stop, where I might not pick up the problem visually. Your experience may differ.

Eddie


Last edited by LitusSaxonicum on Mon Sep 23, 2019 1:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Mon Sep 23, 2019 1:27 am    Post subject: Reply with quote

Yes, Eddie, i am trying to avoid some combinations (i afraid l the most, taking always L which often does not look pretty) , but unfortunately logic of the human and mathematical language sometimes requires to take zeroes and l, 1, i etc.

I remember ones in the beginning of 80th i in seconds helped to fix O-0 problem from one desperate guy who was searching for the bug for several days! And now FTN95 took the hell out of me for almost one hour, imagine how i was furious, thinking i am kind of almost a pro Sad
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Mon Sep 23, 2019 2:28 am    Post subject: Reply with quote

Here is another example of not perfect diagnostics in this demo
Code:
Do i=1,111
  if(i.eq.2) then
  a=i
end do
end

Code:
0004) end do
*** Nesting error - this statement belongs to the DO construct at line 1, but
    is embedded in the block IF construct starting at line 2
    1 ERROR  [<main program> FTN95 v8.51.0]
*** Compilation failed


Instead of telling that possibly ENDIF is missing as most probable error the FTN95 starts showing its Cambridge and finishing school education talking about DO loop constructs which is by the way completely fine. Assuming opposite (that by the enddo user meant endif) means double error which is less probable
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Mon Sep 23, 2019 8:21 am    Post subject: Reply with quote

And here i may misinterpret English possibly:

Code:
text64 = trim(SaveDirName

*** Unpaired right bracket(s)


Why this is called "Unpaired right bracket" while it is unpaired left bracket?
It is "missing right bracket" but if unpaired then unpaired is left one
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Mon Sep 23, 2019 10:59 am    Post subject: Reply with quote

Ah yes. Thank you. That has now been fixed.
Back to top
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Sep 25, 2019 9:42 pm    Post subject: Reply with quote

on the 15th sept, JohnC wrote:
Quote:
'Missing left bracket (s)' implies that the right bracket should be there.

Not always the case !!


They're both not always the case, Hence they're both imprecise !

Just needs 2 different error messages, to be precise. Smile
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Sep 25, 2019 9:49 pm    Post subject: Reply with quote

also on 15th sept. mecej4 wrote
Quote:
(I exclude the fixed form absurdity that this could be an attempt to declare an integer variable with the name 'functionSelect_Slider', with ')' added as a typo.)

with 4 possibl 'interpretations' listed after asking what would be the most appropriate error message.

The answer is ' no single one of them !' clarly in that very well explained conundrum ALL possibilities should be offered to the user, whiìo is the only one that knows what he actually intended !

and as you rightly say, no compiler is intelligent enoiugh to work that out for itself, which is why A.I. is such a pie-in-the sky concept , except if in it' spare time it's an automaton gypsy palm reader on the end of Blackpool pier that is Wink

mecej4 then went on to say, in suggesting that I have a 'favourite phrase' ....
Quote:
ii) incorrectly claiming that a function declaration must contain a left bracket (or left parenthesis).


... but who's talking about 'must' - surely we're talking about error messages which might/could/ conceivably be useful to the user, not the generation of an all-singing-all-dancing-catch-all phrase which, as we've seen (and Dan is imo totally justified in his moan) are all too often completely confusing and sometimes absolutely useless to the average user.

It's a bit like saying 'what colour is an elephant ? what colour is a mouse ? and then concluding that elephants are mice.There is often no single applicable error message for any given error, and programmer's at the level we're talking about have a tendance to try to cme up with such single phrases.
There's also the insìdiscuteble complicating factor of heritage code.
The expansion of error messageing is often hamstrung by the fact that those messages are included in heritage code that is just 'simply used as is' and hencea compiler developer is restricted in what he can subsequently add without a lot of effort.
Depeds how much one wants to be the undisputed Fred Astaire style compiler champion of the world I guess, for which you need to stick on the top hat and brush up the tails, nd not just hang out the white tie in resignation to defeat before even starting.

Meanwhile, all this talk of missing brackets reminds me of the tale of Curly Pi, maybe he could help with coming up with the definitive suitable error message.
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Page 6 of 8

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group