Hacker News new | ask | show | jobs
by mike-cardwell 3409 days ago
Because they want the correct results?
2 comments

During the past years of coding in C++ in the context of tensor networks in condensed matter physics, I have never encountered the case where a programming error which would have been caught in Rust or Go lead to incorrect results. Yes, there were plenty of crashes and plenty of hard to debug issues, but it was always obvious that something was wrong way before any results were calculated/printed/output.
I was thinking the same thing when I read this quote:

> For instance, a common source of error is the access to invalid memory regions, which produces random execution behaviors and affects the scientific interpretation of the results.

Such errors are astronomically more likely to cause crashes than silent errors in calculations.

Does your statement in some way address my point that "wanting correct results" is a legitimate reason to "care about safety in a science context" ?
Yes: Safety does not get you correct results where non-safety would have given you wrong results. Safety gives you correct results in some cases where non-safety would have given you no result. Those cases are easy to identify and can be solved using standard debugging techniques.

So safety gets you faster development: less debugging, easier parallelisation etc., but it does not give you correct results, nor does it give you those results by spending less computational time.

You legitimately can not imagine a scenario where a program is written which could give a result that appears correct but isn't due to a bug?

And you legitimately can't imagine how reducing the likelihood of making bugs by using a language+compiler which can identify/prevent more of them would help?

I'll leave you to it then.

I definitely encountered such issues in solid state physics. But they are very rare. The likelihood of a crash or an obviously wrong result is perhaps three orders of magnitude higher.
While I appreciate Rust and Go, this can already be achieved by using the well established Fortran.

Fortran 2008 is already quite modern in language features and doesn't suffer from C safety issues.

EDIT: typo.