From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: does a safer language mean it is slower to run? Date: Thu, 8 Jun 2023 10:00:52 +0200 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 8 Jun 2023 08:00:52 -0000 (UTC) Injection-Info: dont-email.me; posting-host="120999917a328fef50d63d6e07827727"; logging-data="1533812"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/c9oSaCHmwE0JbV/7Mavu+deqz46DsjmU=" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cancel-Lock: sha1:FiQ4yRJS+xOxXvAS3uSrgioJibo= In-Reply-To: Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:65301 List-Id: On 2023-06-08 05:55, Nasser M. Abbasi wrote: > Some folks in this thread > > https://discourse.julialang.org/t/comparison-of-rust-to-julia-for-scientific-computing/78508 > > "I’m not an expert, but my feeling is that Rust is a “safer” language, > which to me means it must be slower." I think comparison is misplaced. Julia is an interpreted language, very slow, on par with Python. It has memory mapped arrays like Ada does, but lacks Python's precompiled modules. The syntax is wonderfully arbitrary and unpredictable... > Some in that thread seem to argue that a safer language > will/could be slower than otherwise. > Since Ada is known to be one of the safest languages, > do others here feel there is any truth to this? > > I thought that by having more type information in the language, > the compile will be able to make more optimizations (because it > know more), and hence the generated code should actually be > faster, not slower with a language that is less safe? > > I am not a compiler expert but what do others here think? If safety is prevention of logical errors (bugs) you and your team and people deploying the software could make, then techniques and processes determine the outcome. The language can only support certain techniques. Of these techniques and processes some may require run-time overhead. When people compare languages, they frequently do programming techniques instead. As it was observed many decades ago: "Besides, the determined Real Programmer can write Fortran programs in any language." And finally, if you determined to use some technique, then lack of language support makes the language less safe. E.g. if you are in some agile programming lager then semantic constraints imposed by Ada would make things only worse. Even Brainf*ck might be the safest language under circumstances... (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de