comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Not to incite a language war but apparently the Corona lockdown was based on 13 year old undocumented C-Code
Date: Mon, 11 May 2020 23:27:04 +0300
Date: 2020-05-11T23:27:04+03:00	[thread overview]
Message-ID: <hhtqooFq5vU1@mid.individual.net> (raw)
In-Reply-To: <N6huG.179867$2U3.174684@fx04.iad>

On 2020-05-11 21:49, Rick Newbie wrote:
> This link is probably not reported in the MSM very much but I think it's 
> relevant. Not that I believe that Ada would have magically made 
> everything better,

Who knows... but certainly not "magically", rather by design and technology.

> but to base the decision to destroy the Western economies on code
> written in the C language that isn't even commented is somewhat out
> of dystopian fantasy.
The absence of comments does not make the code automatically incorrect.

I've seen people who are smart and good scientists, but amateur 
programmers, make quite complex and demanding programs which work, 
although the programs are ugly and clumsy by the standards of 
professional programming. These programs are often very scantily commented.

Professional programming gives great weight to code qualities that 
assist and support correctness and maintainability. But these qualities 
are not sine qua non for correctness. Amateur programmers do not 
understand that up-front investment in such qualities pays off in the 
longer run, but scientists can be very careful and meticulous in their 
coding -- they are used to taking such care in their other scientific work.

> There's a reason C is not used in safety critical applications.
Oh, it is used. Lots. What's more, some nuclear installations use Forth, 
I kid you not. With "sufficient" process controls and validations, it 
can work.

> I want to share this article here before it gets buried in the memory hole
> 
> 
> https://chrisvoncsefalvay.com/2020/05/09/imperial-covid-model/

I've seen a somewhat longer and better review of this code, but I didn't 
save the link (sorry). The following points were criticized IIRC:

- The original code was a single file, some 15 000 lines. This is not a 
problem in itself -- a good IDE can easily handle and navigate such a 
file -- but the possible poor modularization of the code, and the 
possible prevalence of global variables, could be. Nothing was said in 
the review about modularization or global variables. Note that even a 
single large source-code file can be well modularized.

- The code contains very few comments and lots of complex expressions 
with non-obvious meaning. As I said above, this does not mean it is 
incorrect, only that it is hard to review and maintain (which are real 
problems, sure).

- If the code is executed using multiple cores, the results are not 
deterministic, apparently because the code uses random numbers to drive 
a simulation with many parallel but interacting "actors", distributed 
over the cores, without global synchronization. The reviewer considered 
this to be a grave fault and indicative of poor programming and design. 
It seems to me that even professional programmers would be hard put to 
ensure deterministic results in multi-core execution of such a 
simulation. Moreover, the code is deterministic if executed on a single 
core (after some errors were corrected which seemed not to be unusually 
alarming).

- The authors of the code defended the non-determinism by saying that 
the simulation is statistical, anyway, and that all simulations should 
be repeated several times to get an ensemble of possible behaviour. The 
reviewer did not accept this defense, but insisted on determinism. 
However, I know of at least one example where non-determinism is 
accepted and used in this way: simulations of many-body gravitational 
systems, such as planetary systems, where it is very common to compute 
thousands or millions of simulations and then estimate the likelihood of 
particular final outcomes (say, the ejection of one planet from the 
system) from the ensemble of simulations.

Notably, the reviewer did not claim any errors resulting from the use of 
C instead of other languages. Of course, that may have been the ordinary 
myopia of seeing C as the "normal" choice :-)

-- 
Niklas Holsti
niklas holsti tidorum fi
       .      @       .

  reply	other threads:[~2020-05-11 20:27 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 18:49 Not to incite a language war but apparently the Corona lockdown was based on 13 year old undocumented C-Code Rick Newbie
2020-05-11 20:27 ` Niklas Holsti [this message]
2020-05-11 21:12   ` Rick Newbie
2020-05-12 20:11     ` Niklas Holsti
2020-05-12 20:53       ` Dmitry A. Kazakov
2020-05-12 21:54         ` Niklas Holsti
2020-05-12 22:15       ` Rick Newbie
2020-05-13 11:07         ` Niklas Holsti
2020-05-13 13:23           ` Rick Newbie
2020-05-13 13:45             ` Niklas Holsti
2020-05-13 14:58               ` Rick Newbie
2020-05-13 15:31                 ` Dmitry A. Kazakov
2020-05-13 15:48                   ` Niklas Holsti
2020-05-11 21:45   ` gautier_niouzes
2020-05-12 15:56     ` Niklas Holsti
2020-05-11 21:55   ` Jeffrey R. Carter
2020-05-12 19:16     ` Niklas Holsti
2020-05-12 21:27       ` Jeffrey R. Carter
2020-05-12 22:20         ` Niklas Holsti
2020-05-12 22:39           ` Jeffrey R. Carter
2020-05-13  9:36             ` Niklas Holsti
2020-05-13 13:52               ` Optikos
2020-05-13 14:05                 ` Niklas Holsti
2020-05-13 18:58                   ` Optikos
2020-05-13 20:29                     ` Niklas Holsti
2020-05-13 21:02                       ` Optikos
2020-05-13 21:48                         ` Niklas Holsti
2020-05-13 22:13                           ` Optikos
2020-05-13  9:54         ` Niklas Holsti
2020-05-13  0:25 ` Olivier Henley
2020-05-15 13:23   ` Optikos
2020-05-16  5:01 ` Anatoly Chernyshev
2020-05-28 21:45   ` Optikos
2020-06-11 17:28   ` Olivier Henley
2020-06-11 17:36     ` Olivier Henley
2020-06-11 22:43     ` Anatoly Chernyshev
2020-06-12 12:10       ` Olivier Henley
2020-06-12 12:34         ` Anatoly Chernyshev
2020-06-12 17:36           ` Olivier Henley
2020-06-21  9:18             ` Anatoly Chernyshev
2020-06-22 13:36               ` Olivier Henley
2020-05-16 22:31 ` Niklas Holsti
2020-05-16 23:54   ` Optikos
2020-05-17 15:41     ` Niklas Holsti
2020-05-17 17:38       ` Optikos
2020-05-17 18:00         ` Simon Wright
2020-05-17 20:56           ` Optikos
2020-05-17 21:20             ` Simon Wright
2020-05-17 21:45               ` Optikos
2020-05-18  7:34                 ` Simon Wright
2020-05-17 19:20         ` Niklas Holsti
2020-05-17 21:30           ` Optikos
2020-05-24 21:04 ` Bob Goddard
2020-05-31 15:01 ` Azathoth Hastur
2020-06-09  6:30 ` gautier_niouzes
2020-06-11 15:35 ` Olivier Henley
2020-06-11 15:49   ` Olivier Henley
2020-06-11 18:41     ` Anh Vo
2020-06-11 19:58       ` Olivier Henley
2020-06-11 20:41         ` Anh Vo
2020-06-11 20:47           ` Olivier Henley
2020-06-11 21:34             ` Anh Vo
2020-06-11 21:47               ` Olivier Henley
2020-06-11 21:39             ` Olivier Henley
2020-06-11 23:14               ` Anh Vo
2020-06-11 23:30                 ` Jere
2020-06-11 23:55                   ` Olivier Henley
2020-06-12  0:07                 ` Olivier Henley
2020-06-12  0:42                   ` Anh Vo
2020-06-12 11:08                     ` Olivier Henley
2020-06-12  7:03   ` gautier_niouzes
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox