Article View: comp.arch
Article #222Re: Comment delimiters
From: Thomas Koenig
Date: Mon, 19 Oct 2026 18:09
Date: Mon, 19 Oct 2026 18:09
146 lines
7150 bytes
7150 bytes
EricP <ThatWouldBeTelling@thevillage.com> schrieb:
> On 2026-Oct-17 10:58, Thomas Koenig wrote:
>> EricP <ThatWouldBeTelling@thevillage.com> schrieb:
>>
>>> DEC F77 had a number of enhancements which made the language
>>> more friendly, like tab in column 1 skips to the start of a
>>> statement
>>
>> That didn't make it into the language, and also makes calculation
>> of the line length a bit awkward. When should the line end?
>> Remember, collumn 73-80 are ignored.
>
> That shouldn't be a problem.
> A tab in columns 1 to 6 meant jump to column 7, the statement start.
As long as your editor shows this correctly, and does not indent
up to column 8...
> DEC also optionally allowed lines up to 132 characters -
> the full width of a VT100 in widescreen mode!
Nice way to get vendor lock-in. But it made it into Fortran 90,
but only in free format. Fixed format stayed at the limits of the
IBM 704, which could only read 72 characters from a punched card
because thy used the accumulator and their MQ register for it to
read a line.
>
>>> or ! anywhere is a comment to end of line.
>>
>> Was that a DEC extension? At least it was adapted in Fortran 90.
>
> Yes
>
> There were lots more. 32 character variables (up from the standard 8).
Six, actually - the 704 strikes again. But when Fortran 77
was defined, 36-bit machines with six-bit characters still were
still around, so it was handy to have one word as a symbol
(for compiler writers, not so much for users...)
> DEC F77 used a stack and allowed recursion if you were careful
> whereas IBM F77 did not (it used static allocation for all local
> variables so recursion stomped on their values).
OS/360 calling conventions is one thing they got wrong.
>>> These were adopted by many other F77 compiler vendors
>>> presumably because they wanted to get their customers.
>>
>> They are a rat's nest. Yes, many were convenient, but compilers
>> more or less have to keep supporting them for legacy code.
>> gfortran has -fdec, which in turn enables around ten extensions,
>> but not everything is implemented, for example variable formats
>> or the infamous Q format descriptor.
>>
>> And, of course, the (in)famous PARAMETER X=20 snafu.
>
> I don't know that one. Do tell...
A pre-version of FORTRAN 77 had PARAMETER X = 20, and DEC
pre-implemented this. The committee then settled on
PARAMETER (X=20) .
Can't blame them too much, I sort of made the same mistake again.
>
>>> Parenthesis can be used to force an order of execution.
>>> The parenthesis ordering rule is also data type dependent.
>>> It applies to integer, logical (also integer) and real but not strings.
>>
>> Not sure what use they would be for strings... but where did you get
>> that information from?
>
> I have a 1988 copy of the DEC Fortran manual.
> I was looking at it for a specific set of parenthesis rules
> but no such luck. But it did say that parenthesis do not affect
> the value of a character string.
>
> My point being that whereas in many languages the parser can
> toss parenthesis, in F77 expressions they may be significant,
> and that significance may be semantic dependent.
They are significant, especially in floating point. Assume (a -
b) + c, where a + c can overflow or cause cancellation.
This allows the progammer control over association where it is
important.
>
>>> #1 a + b + c Unordered
>>> #2 (a+b) + c a+b before +c
>>> #3 a + (b+c) b+c before +a
>>>
>>> This would interact with common subexpression elimination.
>>> Above would not be able to optimize all 3 expressions to 1.
>>> It can replace #1 with #2 or #3, but not both.
>>>
>>> I'm not sure but I think parenthesis also could block optimizations
>>> like a*b+a*c => a*(b+c) but (a*b)+(a*c) might not be optimized.
>>
>> The rule is simple: In Fortran, parameters have to be honored,
>> otherwise the rules of standard mathematics apply. So,
>> a + b - a can be optimized to b.
>>
>
> Yes but determining if two expressions are equivalent
> and therefore candidates for elimination can require
> some massaging first.
>
>#4 a + ((b+c))
>
> the first ( is significant, the second ( is redundant,
> and #4 should match #3 and not #2.
>
> But the following string expressions are all equivalent
>
>#5 ('ABC')//('DE')//'F'
>#6 'ABC'//('DE'//'F')
>#7 'ABC'//'DE'//'F'
This should actually be the same. But today's Fortran does
not specia-case strings anyway:
10.1.8
Integrity of parentheses
1 The rules for evaluation specified in 10.1.5 state certain
conditions under which a processor can evaluate an expres- sion
that is different from the one specified by applying the rules
given in 10.1.2 and the rules for interpretation specified in
10.1.5. However, any expression in parentheses shall be treated
as a data entity.
NOTE
For example, in evaluating the expression A + (B – C) where A, B, and
C are of numeric types, the difference of B and C shall be evaluated
before the addition operation is performed; the processor shall not
evaluate the mathematically equivalent expression (A + B) – C.
--
This USENET posting was made without artificial intelligence,
artificial impertinence, artificial arrogance, artificial stupidity,
artificial flavorings or artificial colorants.
Technical Details
Message-ID:
<11b5mdi$2a843$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<1791742457-5857@newsgrouper.org> <11aig3c$3hdcn$1@dont-email.me> <11aiqc0$3kr94$3@dont-email.me> <179190779286.25645.14465927900754526737@media.vsta.org> <179190779286.25645.14465927900754526737@media.vsta.org> <vandys@vsta.org> <jwvjynl2cg0.fsf-monnier+comp.arch@gnu.org> <808vclt9i2mso89n1itvnvos5j88g1mopl@4ax.com> <6acfc2b2.1547984@news.eternal-september.org> <HZQzS.6$TYg.3@fx21.iad> <2026Oct15.081750@mips.complang.tuwien.ac.at> <9ysAS.182538$QPx3.16043@fx17.iad> <2026Oct16.195605@mips.complang.tuwien.ac.at> <zhLAS.37514$1l6.27878@fx42.iad> <11b02fd$9e1u$1@dont-email.me> <465BS.66342$ACx3.13820@fx15.iad>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Thomas Koenig <tkoenig@netcologne.de> Newsgroups: comp.arch Subject: Re: Comment delimiters Date: Mon, 19 Oct 2026 18:09:55 -0000 (UTC) Organization: A noiseless patient Spider Lines: 146 Message-ID: <11b5mdi$2a843$1@dont-email.me> References: <1791742457-5857@newsgrouper.org> <11aig3c$3hdcn$1@dont-email.me> <11aiqc0$3kr94$3@dont-email.me> <179190779286.25645.14465927900754526737@media.vsta.org> <179190779286.25645.14465927900754526737@media.vsta.org> <vandys@vsta.org> <jwvjynl2cg0.fsf-monnier+comp.arch@gnu.org> <808vclt9i2mso89n1itvnvos5j88g1mopl@4ax.com> <6acfc2b2.1547984@news.eternal-september.org> <HZQzS.6$TYg.3@fx21.iad> <2026Oct15.081750@mips.complang.tuwien.ac.at> <9ysAS.182538$QPx3.16043@fx17.iad> <2026Oct16.195605@mips.complang.tuwien.ac.at> <zhLAS.37514$1l6.27878@fx42.iad> <11b02fd$9e1u$1@dont-email.me> <465BS.66342$ACx3.13820@fx15.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 19 Oct 2026 18:09:55 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2433155"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19v0QxkiigsV4v8DYJW4AfW6o8AQ4xsAm0="; posting-host="ceacc5a02aa252f196a3e0a280f0ec67" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:AyOT7v2TqZ8WluCNrFNYQWmUmRg= sha256:jpN+cCBqyzHUW6MEUUQGeJn9ID/ZW84d4VHR5rvqBes= sha1:7su6+R8iM9q4/LW9/hLsMcLPrgk= sha256:AscV/EjZvIomw9N4OuwTuDQCEYarHdiFMSazAW6z5b0=