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."
etc..
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?
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."
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?
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?
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[I guess this is OT.] Julia is a hot mess. Rather than being interpreted, it uses a just-in-time compiler, so they claim they have the solution to the "two-language problem" of prototyping in a slow language such as Python then re-writing in a compiled
and unpredictable...
On 08/06/2023 04: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."
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."
etc..
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?
--Nasser
On 2023-06-08 6: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."
etc..
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 a language needs run-time checks to ensure safety, those checks.
usually take some time, making for slower execution.
If a language has a type system and compilation-time (legality) rules.
such that the compiler can prove that some run-time checks are not
needed, that reduces or eliminates the slow-down. This is the case for Ada.
The effect of type information on optimization is harder (at least for
me) to understand. If the type information lets the compiler assume that some objects are not aliased, that can help optimization because more computation can be done in registers alone, without using main memory.
This applies to Ada, but also applies to standard C, for example,
although some people use non-standard C features (compiler options) to negate this.
However, when comparing the "speed" of two languages and their two implementations I think that the implementations usually matter more
than the languages.
On Thursday, 8 June 2023 at 16:57:17 UTC+10, Niklas Holsti wrote:
On 2023-06-08 6: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."
etc..
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 a language needs run-time checks to ensure safety, those checks.
usually take some time, making for slower execution.
Some language features need run-time checks. These checks cannot be
carried out at compile time.
.
PL/I has some features that require run-time checks. When the computer hardware has certain facilities, that support does not take extra execution time.
For example, floating-point overflow and integer overflow are detected by the hardware on the IBM S/360 and subsequent machines including up to the latest System z. Such detections cause an interrupt that can be handled by the PL/I program. On the PC, integer overflow can cause an interrupt.
.
If a language has a type system and compilation-time (legality) rules.
such that the compiler can prove that some run-time checks are not
needed, that reduces or eliminates the slow-down. This is the case for Ada.
Range is not one of them.
On 2023-10-25 20:01, robin vowels wrote:
On Thursday, 8 June 2023 at 16:57:17 UTC+10, Niklas Holsti wrote:
On 2023-06-08 6: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."
etc..
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 a language needs run-time checks to ensure safety, those checks.
usually take some time, making for slower execution.
Some language features need run-time checks. These checks cannot be
carried out at compile time.
.
PL/I has some features that require run-time checks. When the computer
hardware has certain facilities, that support does not take extra
execution time.
For example, floating-point overflow and integer overflow are detected by
the
hardware on the IBM S/360 and subsequent machines including up to the
latest
System z. Such detections cause an interrupt that can be handled by the
PL/I
program. On the PC, integer overflow can cause an interrupt.
.
If a language has a type system and compilation-time (legality) rules.
such that the compiler can prove that some run-time checks are not
needed, that reduces or eliminates the slow-down. This is the case for
Ada.
Range is not one of them.
/Some/ range checks in Ada can certainly be verified at compile time. For example:
type ABCD is (A, B, C, D);
subtype BCD is ABCD range B .. D;
procedure Foo (X : in BCD)
is
Y : ABCD := X;
Z : ABCD := ABCD'Pred(Y);
...
The initialization of Y formally involves a range check of X, but since
BCD is a subtype of ABCD, the check can be elided at compile time.
Likewise, the initialization of Z, with its computation of the Pred,
formally includes a range check of Y, but since Y /= A can easily be
proved, that range check can also be elided.
The most important type of check that can be elided at Ada compile time is array index check. Because arrays have specific index types in Ada, the compiler can often prove that the index expression will be in range.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 72:13:30 |
Calls: | 8,084 |
Calls today: | 2 |
Files: | 13,069 |
Messages: | 5,850,068 |