News for hackers. Stuff that matters.
Re:Nim vs Rust Benchmarks by duckerude on Monday February 07, 2022 @08:54AM (#30244845)
That speedup is accomplished by using a third-party LRU implementation. I can also speed up the Rust version by 30% by plugging in https://lib.rs/crates/lru.

(The thread points out that the Nim version uses a doubly-linked list from the standard library while you'd need unsafe in Rust, and the lru crate does indeed use unsafe. So take that into account.)

Re:Nim vs Rust Benchmarks by josephg on Monday February 07, 2022 @10:56AM (#30246531)
> you'd need unsafe in Rust

Unsafe is part of the rust language. Theres nothing wrong with using it if you know what you’re doing. The value of unsafe is that it boxes your unsafe code - so you can direct extra care to those functions when writing, reviewing and auditing. (As opposed to C where memory corruption could happen anywhere, so you need to be careful everywhere.)

I could imagine a separate language on the programming languages shootout which is “safe rust”. It’d be interesting how the best unsafe and the best safe programs compare in speed and size.

Re:Nim vs Rust Benchmarks by A-Train on Monday February 07, 2022 @11:28AM (#30247018)
If you believe Rust zero cost abstraction - being safe doesn't mean it has to be compared to safe languages because Rust and C can translate into same assembler code. But in Rust the compiler gives you more guarantees.

I would say that a proper way to rephrase it would be to use idiomatic code vs unidiomatic. If you start using any high-level language in a non intended fashion (writing non idiomatic code) probably most of them would be faster.

Re:Nim vs Rust Benchmarks by staticassertion on Monday February 07, 2022 @10:32AM (#30246195)
Doesn't that just kinda lend further support to the benchmarks being a bit silly?
Re:Nim vs Rust Benchmarks by igouy on Monday February 07, 2022 @02:07PM (#30249474)
Please show the previous support for which that may be "further support".

Meanwhile: it may suggest the comparison is a work in progress, not finished or definitive.

Can data be "silly" or is it what people say about the data that is "silly"?

Re:Nim vs Rust Benchmarks by elcritch on Monday February 07, 2022 @11:01AM (#30246604)
Note that using the third party LRU makes the Nim version faster than the Rust one by 15%. Fixing the Deque/Table Nim version results in the same times as the Rust Dec/HashMap one.