On Monday, 16 July 2012 21:30:51 UTC+10, glen herrmannsfeldt wrote:
> >> On many systems, it isn't so easy to do.
> >> Especially note the IBM 360/91 where I ran many PL/I programs.
>
> > I seem to recall the option NOIMPRECISE.
>
> There is a hardware switch that will turn off much of the
> instruction overlap.
I'm referring to the PL/I compiler option.
> Also, some compilers have options to generate different code.
>
> >> Overflow and underflow are not easy in the case of imprecise
> >> interrupts. You can't get back to where the error actually
> >> occured, and you can't get the address of the data to fix it.
>
> > The data is in a register when underflow and overflow occur.
> > A HLL programmer doesn't usually get the address of registers.
> To find which register,
That's irrelevant. You said that you can't get back
to the data to fix it [in the PL/I program].
You are now talking about analyzing a memory dump,
and using a PSW.
> the tradition is to use the instruction
> length code to back up from the address in the OPSW, then examine
> the offending instruction. From that, you can figure out which
> register contains the result.
Totally irrelevant.
> > In the case of underflow, the standard system action is to
> > proceed with zero. Normal return is to the next instruction.
>
> Depends on the program mask bit, and also is different on the 91.
>
> > In the case of overflow, normal return is to the next instruction.
>
> (snip)
>
> >> try/catch
> >> system you get close, and to a known spot at the appropriate
> >> time, but not exactly back to the point of interruption.
>
> > Precisely my point.
>
> > In PL/I, you have the choice. Either continue from the point
> > of interruption(for certain classes of error) , or,
> > continue from some other appropriate and well-defined place in the
> > program (such as the beginning of a loop, or to terminate the
> > procedure, etc).
> > You don't have that choice with the language you mention.
>
> With try/catch the programmer can make sure that the appropriate
> variables have the right value in each case. As not all processors
> can get back to the point of interruption with the registers
> in the appropriate condition,
When an interrupt occurs, either the processor saves the registers,
or the OS saves the registers. From that, the registers
are restored when the program resumes.
That is required whenever an interrupt occurs.
Without that guarantee, a program could never be guaranteed
to complete execution, because interrupts occur at any time
during the execution of a program from any cause (including
from other programs and/or threads that the OS may be running).
> it might be a better choice.
>
> (snip, I wrote)
> >> It was a huge advance, but also an experiment.
>
> > No it wasn't. It was a new language, intended for production.
> > Are you going to say that the first implementations of
> > Algol, BASIC, C, etc etc etc were 'experiments'?
>
> ALGOL, likely.
No it never was.
>Notice that call-by-name has not been used by
> any other language.
That's irrelevant.
> BASIC has mostly ideas that previously existed in other
> languages, simplified somewhat.
>
> C was preceded by BCPL and B, which could be considered the
> experiments. It took three tries to get it right.
It still isn't.
But that doesn't mean anything. PL/I was preceded by Algol, FORTRAN, COBOL, and many other languages.
> >> Many things hadn't been done
> >> before and were defined into the language
> >> before anyone had time to try them out and understand them.
>
> > It is unlikely that at the time that a new language is released
> > that anyone has time to "try them out".
>
> (snip)
>
> > But in all languages there was a first version,
> > and PL/I was no different from any of the other languages
> > in that respect.
>
> It was different in the number of features added that hadn't
> existed in other languages, or in the way those features were
> combined.
You are forgetting that PL/I improved on what was in COBOL,
Algol, and FORTRAN. It was no different from any of those.
Algol improved on what was previously available.
FORTRAN improved on what preceded it.
In that sense, PL/I was not different from Algol, COBOL, and
FORTRAN, and others that preceded and followed it in time.
> Fortran I was the experiment,
It wasn't an "experiment" It was a serious attempt to get a
compiler that produced code that approached the efficiency
of hand-coded assembler/machine code.
> many things were changed for
> Fortran II, and more for Fortran IV. Note how fast Fortran I
> and Fortran II died out, while Fortran IV lasted much longer.
That's again irrelevant.
In any case, users could perceive things that could be added
to deal with things like changing hardware.
> > Any changes that were made were made as a result of experience
> > with the language, and that was done in the case of PL/I.
> > Though, of course, fewer changes were warranted in the case
> > of PL/I (compared with other languages) because it was
> > well-designed in the first place.
>
> Personally, yes, they did an amazingly good job given the time
> and processors available.
The processor was the S/360.
> They might have done better with more
> time and more testing.
Unlikely. It was many years before new features were added.