"disable all brakes" is misleading. All the basic memory safety stays, static typing is still there, non-debug assertions are still checked.
Removing debugging features is reasonable for such benchmarks, especially if comparing with languages that don't have them.
Re:Nim 1.6.2
by CodesInChaos on Friday December 17, 2021 @01:04PM
(#29595805)
Another poster claimed it disables bounds checks, you claim it still offers basic memory safety. That sounds like a contradiction to me.
I'm sure Rust also has a way to disable bounds/overflow checks for speed. Do benchmarks utilise it?
Rust doesn’t have a compiler flag for this, instead it has separate functions that don’t do the checking. E.g. Vec has a .get_unchecked function.
Such functions can only be used in an unsafe block, and should only be used if bounds checking is handled elsewhere such that it would be impossible to cause an out of bounds error at runtime.
It’s also often possible to get rust to elide bounds checks by using iterators, which often don’t need them as they know the length up front.
Re:Nim 1.6.2
by formerly_proven on Friday December 17, 2021 @06:00AM
(#29590569)
Rust should be able to elide more checks than most other languages without impacting safety.
That's the assumption, but that doesn't mean it's the case. Certainly bounds checks are impossible to prove at compile-time.
Re:Nim 1.6.2
by ObscureScience on Friday December 17, 2021 @07:17AM
(#29591188)
What language are you talking about?
What you want are comparable compiler flags across languages, say "optimized for performance, yet retaining safety" and "go as fast as possible and disable all brakes". Which, to be fair, is the default for C anyway, but this is not a desirable default. I'm sure you can similarly game Rust bechmarks by using "unsafe".