Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

1 + 1 = 3, for large values of 1.


devel / comp.lang.fortran / Re: FORTRAN is faster than C++

SubjectAuthor
* FORTRAN is faster than C++Colin Paul Gloster
+* Re: FORTRAN is faster than C++Thomas Koenig
|`* Re: FORTRAN is faster than C++David Jones
| +* Re: FORTRAN is faster than C++gah4
| |`* Re: FORTRAN is faster than C++Walter H.
| | `* Re: FORTRAN is faster than C++Thomas Koenig
| |  `* Re: FORTRAN is faster than C++Sergey Budaev
| |   `* Re: FORTRAN is faster than C++Thomas Koenig
| |    +* Re: FORTRAN is faster than C++gah4
| |    |`- Re: FORTRAN is faster than C++Thomas Koenig
| |    `- Re: FORTRAN is faster than C++Spiros Bousbouras
| `- Re: FORTRAN is faster than C++Colin Paul Gloster
`- Re: FORTRAN is faster than C++FortranFan

1
FORTRAN is faster than C++

<8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3220&group=comp.lang.fortran#3220

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Master_Fontaine_is_dishonest@Strand_in_London.Gov.UK (Colin Paul Gloster)
Newsgroups: comp.lang.fortran
Subject: FORTRAN is faster than C++
Date: Wed, 18 Jan 2023 20:24:37 +0100
Organization: A noiseless patient Spider
Lines: 4
Message-ID: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=US-ASCII
Injection-Info: reader01.eternal-september.org; posting-host="ba3e3b6b8b9b21981108b7d75f842c62";
logging-data="1085533"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+hEGPgXnRTZ5XZEdCjyxHnc2xLevSo400M6Xdj8ljNFw=="
Cancel-Lock: sha1:BPnSmDj5z3G7sKfmKHOlc3LVaxE=
 by: Colin Paul Gloster - Wed, 18 Jan 2023 19:24 UTC

FORTRAN is faster than C++: HTTPS://authors.Elsevier.com/a/1gRnKcPqbl4hv
Colin Paul Gloster, Comment on "Gamma-ray spectroscopy using angular
distribution of Compton scattering" [Nucl. Instr. and Meth. A 1031 (2022)
166502], 1049:167923, 2023

Re: FORTRAN is faster than C++

<tq9ou3$2qmdi$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3221&group=comp.lang.fortran#3221

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-6a55-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN is faster than C++
Date: Wed, 18 Jan 2023 21:39:15 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tq9ou3$2qmdi$1@newsreader4.netcologne.de>
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>
Injection-Date: Wed, 18 Jan 2023 21:39:15 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-6a55-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:6a55:0:7285:c2ff:fe6c:992d";
logging-data="2972082"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Wed, 18 Jan 2023 21:39 UTC

Colin Paul Gloster <Master_Fontaine_is_dishonest@Strand_in_London.Gov.UK> schrieb:
> FORTRAN is faster than C++: HTTPS://authors.Elsevier.com/a/1gRnKcPqbl4hv
> Colin Paul Gloster, Comment on "Gamma-ray spectroscopy using angular
> distribution of Compton scattering" [Nucl. Instr. and Meth. A 1031 (2022)
> 166502], 1049:167923, 2023

That's a message I like to hear, but unfortunately it's behind a
paywall.

Can you summarize?

Re: FORTRAN is faster than C++

<6cc7f116-175a-402c-ae77-8d77c06c4154n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3222&group=comp.lang.fortran#3222

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:718d:0:b0:3ad:bc63:a957 with SMTP id w13-20020ac8718d000000b003adbc63a957mr354497qto.625.1674079736569;
Wed, 18 Jan 2023 14:08:56 -0800 (PST)
X-Received: by 2002:a9d:7b55:0:b0:670:92ed:297c with SMTP id
f21-20020a9d7b55000000b0067092ed297cmr455808oto.262.1674079736292; Wed, 18
Jan 2023 14:08:56 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 18 Jan 2023 14:08:56 -0800 (PST)
In-Reply-To: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>
Injection-Info: google-groups.googlegroups.com; posting-host=136.226.61.29; posting-account=ZZXq9AoAAAAQEcA7zKAGm0UFQh4gMBv7
NNTP-Posting-Host: 136.226.61.29
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6cc7f116-175a-402c-ae77-8d77c06c4154n@googlegroups.com>
Subject: Re: FORTRAN is faster than C++
From: parekhvs@gmail.com (FortranFan)
Injection-Date: Wed, 18 Jan 2023 22:08:56 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 9
 by: FortranFan - Wed, 18 Jan 2023 22:08 UTC

On Wednesday, January 18, 2023 at 2:24:45 PM UTC-5, Colin Paul Gloster wrote:
> FORTRAN is faster than C++: HTTPS://authors.Elsevier.com/a/1gRnKcPqbl4hv
> Colin Paul Gloster, Comment on "Gamma-ray spectroscopy using angular
> distribution of Compton scattering" [Nucl. Instr. and Meth. A 1031 (2022)
> 166502], 1049:167923, 2023

The actual article makes no reference to the two languages at all. That would be insane. Comparing languages in terms of speed is mostly a meaningless exercise now.

It's actually a very brief comment letter by Gloster (Department of Physics, University of Cambria, Portugal) and as it should, it makes reference to platforms and toolkits such as Geant4, MCNPX, FLUKA for gamma-ray spectroscopy in the physics domain.

Re: FORTRAN is faster than C++

<tqa0eb$1pte$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3223&group=comp.lang.fortran#3223

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!/Adh2v7LvPPHwMhGJ8JsiA.user.46.165.242.91.POSTED!not-for-mail
From: dajhawk18xx@@nowhere.com (David Jones)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN is faster than C++
Date: Wed, 18 Jan 2023 23:47:23 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tqa0eb$1pte$1@gioia.aioe.org>
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl> <tq9ou3$2qmdi$1@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="59310"; posting-host="/Adh2v7LvPPHwMhGJ8JsiA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: XanaNews/1.21-f3fb89f (x86; Portable ISpell)
X-Notice: Filtered by postfilter v. 0.9.2
 by: David Jones - Wed, 18 Jan 2023 23:47 UTC

Thomas Koenig wrote:

> Colin Paul Gloster
> <Master_Fontaine_is_dishonest@Strand_in_London.Gov.UK> schrieb:
> > FORTRAN is faster than C++:
> > HTTPS://authors.Elsevier.com/a/1gRnKcPqbl4hv Colin Paul Gloster,
> > Comment on "Gamma-ray spectroscopy using angular distribution of
> > Compton scattering" [Nucl. Instr. and Meth. A 1031 (2022) 166502],
> > 1049:167923, 2023
>
> That's a message I like to hear, but unfortunately it's behind a
> paywall.
>
> Can you summarize?

It's not worth seeing for itself. It is very brief and it just gives a
very brief list of comparisons of the type "this is faster than that".
There is no indication of what languages or computer resouces are used
for any of these comparisons. There are references for these
comparisons, so these might be followed-up. The only mention of Fortran
is in the reference to "An empirical study of FORTRAN programs" by
Knuth of 1971. Other references are rather more recent. No mention at
all of C or C++. Come comparisons involve using CPU vs GPU.

Perhaps the OP could provide some more direct reference to support the
claim to have evidence that "FORTRAN is faster than C++". Let's hope it
is a fair like-for-like comparison.

Re: FORTRAN is faster than C++

<df2d9b22-d004-4fd1-ac33-80082a86f67fn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3224&group=comp.lang.fortran#3224

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:5652:0:b0:3b6:3f35:9f51 with SMTP id 18-20020ac85652000000b003b63f359f51mr378689qtt.18.1674103809338;
Wed, 18 Jan 2023 20:50:09 -0800 (PST)
X-Received: by 2002:a05:6871:4482:b0:15d:c84a:6d88 with SMTP id
ne2-20020a056871448200b0015dc84a6d88mr700490oab.299.1674103809019; Wed, 18
Jan 2023 20:50:09 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 18 Jan 2023 20:50:08 -0800 (PST)
In-Reply-To: <tqa0eb$1pte$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:adac:2cae:abe4:158f;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:adac:2cae:abe4:158f
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>
<tq9ou3$2qmdi$1@newsreader4.netcologne.de> <tqa0eb$1pte$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <df2d9b22-d004-4fd1-ac33-80082a86f67fn@googlegroups.com>
Subject: Re: FORTRAN is faster than C++
From: gah4@u.washington.edu (gah4)
Injection-Date: Thu, 19 Jan 2023 04:50:09 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 24
 by: gah4 - Thu, 19 Jan 2023 04:50 UTC

On Wednesday, January 18, 2023 at 3:47:27 PM UTC-8, David Jones wrote:

(snip)

> Perhaps the OP could provide some more direct reference to support the
> claim to have evidence that "FORTRAN is faster than C++". Let's hope it
> is a fair like-for-like comparison.

Much of OOP is done with much allocating and deallocating memory.

For many years, static allocation Fortran was faster than many other
languages that use dynamic allocation. But now much Fortran does
use dynamic allocation.

Now, there is no requirement that OOP does a huge amount of allocation,
but it often does. I have not seen that a lot of OOP Fortran is done, and
it might not do as much allocation as some C++ does, though.

In any case, it is a lot the way the language is used, and not so much
the language itself.

Or, you can write slow inefficient code, in any language.

Re: FORTRAN is faster than C++

<e9678a20-f83f-1ede-cca2-6b3891f6019@insomnia247.nl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3229&group=comp.lang.fortran#3229

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Master_Fontaine_is_dishonest@Strand_in_London.Gov.UK (Colin Paul Gloster)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN is faster than C++
Date: Thu, 19 Jan 2023 15:32:32 +0100
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <e9678a20-f83f-1ede-cca2-6b3891f6019@insomnia247.nl>
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl> <tq9ou3$2qmdi$1@newsreader4.netcologne.de> <tqa0eb$1pte$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Injection-Info: reader01.eternal-september.org; posting-host="e8d586cbfc8706c6a27c9236510e529d";
logging-data="1679404"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+xvd75WFNhDFZy2EIYI8kvro5I9p5eg1JbgzdhqQiWw=="
Cancel-Lock: sha1:6Iawtfsn3bEfWeEbgswJ3xa/RYg=
In-Reply-To: <tqa0eb$1pte$1@gioia.aioe.org>
 by: Colin Paul Gloster - Thu, 19 Jan 2023 14:32 UTC

On January 18th, 2023, David Jones wrote:
"[. . .]

[. . .] brief list of comparisons of the type "this is faster than that".
There is no indication of what languages or computer resouces are used
for any of these comparisons. There are references for these
comparisons, so these might be followed-up. [. . .]
[. . .]

Perhaps the OP could provide some more direct reference to support the
claim to have evidence that "FORTRAN is faster than C++". Let's hope it
is a fair like-for-like comparison."

Dear all:

All of the codes in question simulate the same processes of physics. Of
the CPU codes of physics in question, they are all mature and only the
Geant4 code is in C++. The FORTRAN alternatives are fast. The C++
alternative is slow.

Yours faithfully,
Colin Paul Gloster

Re: FORTRAN is faster than C++

<k3mr4lFfoi6U1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3256&group=comp.lang.fortran#3256

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Walter.H-Nntp@mathemainzel.info (Walter H.)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN is faster than C++
Date: Sun, 29 Jan 2023 10:04:22 +0100
Organization: Waldi's NNTP Home
Lines: 15
Message-ID: <k3mr4lFfoi6U1@mid.individual.net>
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>
<tq9ou3$2qmdi$1@newsreader4.netcologne.de> <tqa0eb$1pte$1@gioia.aioe.org>
<df2d9b22-d004-4fd1-ac33-80082a86f67fn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net tuKAQUXeaHMLmGIljCNB4ghpcKzUtUl1HS8zsXHYa1PmF9zuj3
Cancel-Lock: sha1:ijcuqeqq3NhMH8mMoPmY5u9SGe8=
X-No-Archive: yes
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de-DE; rv:60.9.1)
Gecko/20200229 Thunderbird/60.9.1
In-Reply-To: <df2d9b22-d004-4fd1-ac33-80082a86f67fn@googlegroups.com>
Content-Language: en-US
 by: Walter H. - Sun, 29 Jan 2023 09:04 UTC

On 19.01.2023 05:50, gah4 wrote:
> In any case, it is a lot the way the language is used, and not so much
> the language itself.
>
> Or, you can write slow inefficient code, in any language.

true but the optimizer can do a better work the less complicated
statements are possible;
think of pointers to member functions in C++
such is impossible in FORTRAN and there no problems to optimize;

Re: FORTRAN is faster than C++

<tr5o42$3crl9$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3258&group=comp.lang.fortran#3258

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd4-de6f-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN is faster than C++
Date: Sun, 29 Jan 2023 12:17:06 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tr5o42$3crl9$1@newsreader4.netcologne.de>
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>
<tq9ou3$2qmdi$1@newsreader4.netcologne.de> <tqa0eb$1pte$1@gioia.aioe.org>
<df2d9b22-d004-4fd1-ac33-80082a86f67fn@googlegroups.com>
<k3mr4lFfoi6U1@mid.individual.net>
Injection-Date: Sun, 29 Jan 2023 12:17:06 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd4-de6f-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd4:de6f:0:7285:c2ff:fe6c:992d";
logging-data="3567273"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sun, 29 Jan 2023 12:17 UTC

Walter H. <Walter.H-Nntp@mathemainzel.info> schrieb:
> On 19.01.2023 05:50, gah4 wrote:
>> In any case, it is a lot the way the language is used, and not so much
>> the language itself.
>>
>> Or, you can write slow inefficient code, in any language.
>
> true but the optimizer can do a better work the less complicated
> statements are possible;
> think of pointers to member functions in C++
> such is impossible in FORTRAN and there no problems to optimize;

Uh, no. You can also have type-bound procedures since Fortran 2003,
which amount to pretty much the same thing.

Of course, you don't _have_ to use them, but they can be quite
convenient.

Re: FORTRAN is faster than C++

<20230129140146.0d4e5a9a@herring>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3259&group=comp.lang.fortran#3259

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: fortran@sergey.budaev.info (Sergey Budaev)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN is faster than C++
Date: Sun, 29 Jan 2023 14:01:46 +0100
Organization: uib
Lines: 24
Message-ID: <20230129140146.0d4e5a9a@herring>
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>
<tq9ou3$2qmdi$1@newsreader4.netcologne.de>
<tqa0eb$1pte$1@gioia.aioe.org>
<df2d9b22-d004-4fd1-ac33-80082a86f67fn@googlegroups.com>
<k3mr4lFfoi6U1@mid.individual.net>
<tr5o42$3crl9$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: reader01.eternal-september.org; posting-host="0d0e3e2317ee182f8763b30ff2d2882f";
logging-data="2898048"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dPsP4Opz67oVc+gm2U2SV"
Cancel-Lock: sha1:S0O7qRVblP++up47DZiRFSTJU3k=
X-Newsreader: Claws Mail 4.1.0 (GTK 3.22.30; x86_64-pc-linux-gnu)
 by: Sergey Budaev - Sun, 29 Jan 2023 13:01 UTC

>Uh, no. You can also have type-bound procedures since Fortran 2003,
>which amount to pretty much the same thing.
>
>Of course, you don't _have_ to use them, but they can be quite
>convenient.

I guess modern Fortran has pointers, type-bound procedures, associate
blocks that involve pointers in the proper sense. But in Fortran they
are quite limited compared to C++. Also e.g. for gcc the same backend
serves boith C++ and Fortran. A limited F77-style code not using
modern features may allow more aggressive compiler optimization and
might be slightly faster, maybe. But you can also use restrict in C
which to some degree is a solution to aliacing. I therefore do not
expect any really big differences in most real cases.

I have an impression that ifort unlike gfortran includes a kind of
black magic that takes into account the typical ways code is written by
non-programmer engineers, as to loops etc. This may also contribute to
performance.

--
Sergey V. Budaev
Universitetet i Bergen, Institutt for biovitenskap, Teoretisk økologi,

Re: FORTRAN is faster than C++

<tr6sig$3dlpe$3@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3260&group=comp.lang.fortran#3260

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd4-de6f-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN is faster than C++
Date: Sun, 29 Jan 2023 22:39:12 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tr6sig$3dlpe$3@newsreader4.netcologne.de>
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>
<tq9ou3$2qmdi$1@newsreader4.netcologne.de> <tqa0eb$1pte$1@gioia.aioe.org>
<df2d9b22-d004-4fd1-ac33-80082a86f67fn@googlegroups.com>
<k3mr4lFfoi6U1@mid.individual.net>
<tr5o42$3crl9$1@newsreader4.netcologne.de>
<20230129140146.0d4e5a9a@herring>
Injection-Date: Sun, 29 Jan 2023 22:39:12 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd4-de6f-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd4:de6f:0:7285:c2ff:fe6c:992d";
logging-data="3594030"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sun, 29 Jan 2023 22:39 UTC

Sergey Budaev <fortran@sergey.budaev.info> schrieb:
>>Uh, no. You can also have type-bound procedures since Fortran 2003,
>>which amount to pretty much the same thing.
>>
>>Of course, you don't _have_ to use them, but they can be quite
>>convenient.
>
> I guess modern Fortran has pointers, type-bound procedures, associate
> blocks that involve pointers in the proper sense. But in Fortran they
> are quite limited compared to C++.

Not as ubiquitous as in C++, very probably, but they offer the
same sort of power.

> Also e.g. for gcc the same backend
> serves boith C++ and Fortran.

With a few additions. For example, C pointers can escape. Consider

int a;
foo (&a);
printf ("%d\n",a);
a = 42;
bar ();
printf ("%d\n",a);

The compiler (and the reader) cannot assume that bar does not
change the value of a, because foo might have stashed it away in
static storage somewhere. Yes, this is a nuisance.

Gcc contains a way for Fortran to tell the middle end that pointers
can not, in fact, escape this way.

>A limited F77-style code not using
> modern features may allow more aggressive compiler optimization and
> might be slightly faster, maybe. But you can also use restrict in C
> which to some degree is a solution to aliacing.

Fortran does make it easier, especially by default.

> I therefore do not
> expect any really big differences in most real cases.

That's hard to say without benchmarks.

Passing Fortran arrays with assumed shape actually carries some
overhead, especially for small arrays. This is much clearer
and less error-prone than what C can do (especially for small,
multi-dimensional arrays), but a compiler needs inter-procedural
analysis to get rid of that overhead.

> I have an impression that ifort unlike gfortran includes a kind of
> black magic that takes into account the typical ways code is written by
> non-programmer engineers, as to loops etc. This may also contribute to
> performance.

Hm, I somehow doubt that it's magic.

Re: FORTRAN is faster than C++

<4d734e50-d13d-46a0-8659-51f84832f836n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3261&group=comp.lang.fortran#3261

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:5d94:b0:3a5:7c31:2e3e with SMTP id fu20-20020a05622a5d9400b003a57c312e3emr1400659qtb.111.1675054214575;
Sun, 29 Jan 2023 20:50:14 -0800 (PST)
X-Received: by 2002:aca:110d:0:b0:378:4497:9ef7 with SMTP id
13-20020aca110d000000b0037844979ef7mr200068oir.123.1675054214271; Sun, 29 Jan
2023 20:50:14 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sun, 29 Jan 2023 20:50:14 -0800 (PST)
In-Reply-To: <tr6sig$3dlpe$3@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:7cc2:6fc1:e444:1cae;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:7cc2:6fc1:e444:1cae
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>
<tq9ou3$2qmdi$1@newsreader4.netcologne.de> <tqa0eb$1pte$1@gioia.aioe.org>
<df2d9b22-d004-4fd1-ac33-80082a86f67fn@googlegroups.com> <k3mr4lFfoi6U1@mid.individual.net>
<tr5o42$3crl9$1@newsreader4.netcologne.de> <20230129140146.0d4e5a9a@herring> <tr6sig$3dlpe$3@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4d734e50-d13d-46a0-8659-51f84832f836n@googlegroups.com>
Subject: Re: FORTRAN is faster than C++
From: gah4@u.washington.edu (gah4)
Injection-Date: Mon, 30 Jan 2023 04:50:14 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2968
 by: gah4 - Mon, 30 Jan 2023 04:50 UTC

On Sunday, January 29, 2023 at 2:39:16 PM UTC-8, Thomas Koenig wrote:

(snip)

> int a;
> foo (&a);
> printf ("%d\n",a);
> a = 42;
> bar ();
> printf ("%d\n",a);
> The compiler (and the reader) cannot assume that bar does not
> change the value of a, because foo might have stashed it away in
> static storage somewhere. Yes, this is a nuisance.

But Fortran has COMMON, and now module variables, which can
change at surprising times. Maybe not as surprising as for C.
Even so, the compiler has to assume that any COMMON variable,
and many module variables, can change.

Where are the rules on when pointed-to variables can change?
With C-interoperability, one could call C programs that keep pointers.

> Gcc contains a way for Fortran to tell the middle end that pointers
> can not, in fact, escape this way.

(snip)
> Passing Fortran arrays with assumed shape actually carries some
> overhead, especially for small arrays. This is much clearer
> and less error-prone than what C can do (especially for small,
> multi-dimensional arrays), but a compiler needs inter-procedural
> analysis to get rid of that overhead.
Dynamic allocation, and especially the complications of assumed shape,
do have overhead. In the olden days (through Fortran 77) static allocation
allows low overhead access to arrays.

On the other hand, static sized arrays have their own overhead, especially
when they have to be sized the largest they might ever need to be.

Re: FORTRAN is faster than C++

<tr7v1r$3ecb2$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3263&group=comp.lang.fortran#3263

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd4-de6f-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN is faster than C++
Date: Mon, 30 Jan 2023 08:27:39 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tr7v1r$3ecb2$1@newsreader4.netcologne.de>
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl>
<tq9ou3$2qmdi$1@newsreader4.netcologne.de> <tqa0eb$1pte$1@gioia.aioe.org>
<df2d9b22-d004-4fd1-ac33-80082a86f67fn@googlegroups.com>
<k3mr4lFfoi6U1@mid.individual.net>
<tr5o42$3crl9$1@newsreader4.netcologne.de>
<20230129140146.0d4e5a9a@herring>
<tr6sig$3dlpe$3@newsreader4.netcologne.de>
<4d734e50-d13d-46a0-8659-51f84832f836n@googlegroups.com>
Injection-Date: Mon, 30 Jan 2023 08:27:39 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd4-de6f-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd4:de6f:0:7285:c2ff:fe6c:992d";
logging-data="3617122"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Mon, 30 Jan 2023 08:27 UTC

gah4 <gah4@u.washington.edu> schrieb:
> On Sunday, January 29, 2023 at 2:39:16 PM UTC-8, Thomas Koenig wrote:
>
>
> (snip)
>
>> int a;
>> foo (&a);
>> printf ("%d\n",a);
>> a = 42;
>> bar ();
>> printf ("%d\n",a);
>
>> The compiler (and the reader) cannot assume that bar does not
>> change the value of a, because foo might have stashed it away in
>> static storage somewhere. Yes, this is a nuisance.
>
> But Fortran has COMMON, and now module variables, which can
> change at surprising times.

Yes.

> Maybe not as surprising as for C.
> Even so, the compiler has to assume that any COMMON variable,
> and many module variables, can change.

But not that they may alias with arguments.

And the problem with C is that there is no way to get an INTENT(OUT)
equivalent _without_ pointers potentially escaping, unless you do
something like

int a;
{
int b;
foo (&b);
a = b;
}
printf ("%d\n",a);
a = 42;
bar ();
printf ("%d\n", a);

which is verbose, error-prone and which hardly anybody ever does.

[...]

Re: FORTRAN is faster than C++

<3B4rAOqdFVy7cC9Qh@bongo-ra.co>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3264&group=comp.lang.fortran#3264

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.cyber23.de!.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN is faster than C++
Date: Mon, 30 Jan 2023 15:07:36 -0000 (UTC)
Organization: Cyber23 news
Message-ID: <3B4rAOqdFVy7cC9Qh@bongo-ra.co>
References: <8c78eaf1-a8cf-11df-35ab-239bf18af114@insomnia247.nl> <tq9ou3$2qmdi$1@newsreader4.netcologne.de> <tqa0eb$1pte$1@gioia.aioe.org>
<df2d9b22-d004-4fd1-ac33-80082a86f67fn@googlegroups.com> <k3mr4lFfoi6U1@mid.individual.net> <tr5o42$3crl9$1@newsreader4.netcologne.de>
<20230129140146.0d4e5a9a@herring> <tr6sig$3dlpe$3@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 Jan 2023 15:07:36 -0000 (UTC)
Injection-Info: news.cyber23.de;
logging-data="24841"; mail-complaints-to="abuse@cyber23.de"
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
In-Reply-To: <tr6sig$3dlpe$3@newsreader4.netcologne.de>
 by: Spiros Bousbouras - Mon, 30 Jan 2023 15:07 UTC

On Sun, 29 Jan 2023 22:39:12 -0000 (UTC)
Thomas Koenig <tkoenig@netcologne.de> wrote:
> With a few additions. For example, C pointers can escape. Consider
>
> int a;
> foo (&a);
> printf ("%d\n",a);
> a = 42;
> bar ();
> printf ("%d\n",a);
>
> The compiler (and the reader) cannot assume that bar does not
> change the value of a, because foo might have stashed it away in
> static storage somewhere. Yes, this is a nuisance.

If foo() has been declared as
whatever foo(const int *p)

then it can only copy the value of p to another const * int
pointer and you cannot change the value of a through that.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor