HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Dr_Emann

no profile record

Submissions

Show HN: One Million Sliders

onemillionsliders.com
1 points·by Dr_Emann·2 yıl önce·0 comments

comments

Dr_Emann
·14 gün önce·discuss
I don't think so, "while vacant" is an infinite amount of time, if you look infinitely far into the future.
Dr_Emann
·2 ay önce·discuss
"Participants got behind the wheel of a driving simulator equipped with everything you’d find in a real car – from the steering wheel to the pedals and dashboard. A large touchscreen, similar to those found in newer vehicles, allows for music to play and text messages to come through. Three oversized monitors provide 180 degrees of visual coverage to create a realistic, immersive driving environment."

Seems pretty clearly a simulator, they use that word several times.
Dr_Emann
·3 ay önce·discuss
To be even fair-er, it wasn't actually memory unsafety, it was "just" unsoundness, there was a type, that IF you gave it an io reader implementation that was weird, that implementation could see uninit data, or expose uninit data elsewhere, but the only readers actually used were well behaved readers.
Dr_Emann
·9 ay önce·discuss
Thats kinda the problem, there are concepts in rust that don't have equivalents in other common languages. In this case, rust's type system models data-race-safety: it prevents data races at compile time in a way unlike what you can do in c or c++. It will prevent getting mutable access (with a compile time error) to a value across threads unless that access is syncronized (atomics, locks, etc)
Dr_Emann
·10 ay önce·discuss
Rust has access control. Fields are private by default.
Dr_Emann
·geçen yıl·discuss
Wow the comments are.. Bad. Not all single instruction operations are the same.
Dr_Emann
·geçen yıl·discuss
"The common ground is that I have absolutely no interest in helping to spread a multi-language code base. I absolutely support using Rust in new codebase, but I do not at all in Linux." https://lwn.net/ml/all/[email protected]/

That doesn't sound like he's only talking about in his area to me
Dr_Emann
·2 yıl önce·discuss
Hi, I think even the remaining benchmark isn't showing what you're trying to show:

https://rust.godbolt.org/z/r9rP6xohb

Rust realizes the vector is never used, and so never does any allocation, or recursion, it just turns into a loop to count up to 999_999_999.

And some back of the napkin math says there's no way either benchmark is actually allocating anything. Even if malloc took 1 nanosecond (it _doesn't_), 999_999_999 nanoseconds is 0.999999999 seconds.

It _is_ somewhat surprising that rust doesn't realize the loop can be completely optimized away, like it does without the unused Vec, but this benchmark still isn't showing what you're trying to show.
Dr_Emann
·2 yıl önce·discuss
Rust optimizes factorial to be iterative, not using recursion (tail or otherwise) at all, and it turns `factorial(15, 1)` into `1307674368000`: https://rust.godbolt.org/z/bGrWfYKrP. As has been pointed out a few times, you're benchmarking `criterion::black_box` vs `benchmark.keep` (try the newer `std::hint::black_box`, which is built into the compiler and should have lower overhead)

And no: in the example with `&String` and `usize`, the stack isn't growing: https://rust.godbolt.org/z/6zW6WfGE7