Dr_Emann | 4 months ago | on: Upcoming Rust language features for kernel development
Dr_Emann's comments
Dr_Emann | 5 months ago | on: DARPA project for automated translation from C to Rust (2024)
Dr_Emann | 11 months ago | on: Speeding up C++ code with template lambdas
Dr_Emann | 1 year ago | on: Asahi Linux lead developer Hector Martin resigns from Linux kernel
That doesn't sound like he's only talking about in his area to me
Dr_Emann | 2 years ago | on: Mojo vs. Rust: is Mojo faster than Rust?
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 years ago | on: Mojo vs. Rust: is Mojo faster than Rust?
And no: in the example with `&String` and `usize`, the stack isn't growing: https://rust.godbolt.org/z/6zW6WfGE7
Dr_Emann | 3 years ago | on: A byte string library for Rust
Dr_Emann | 4 years ago | on: The Bourne shell lets you set variables in if expressions
rc=0 long command || rc = $? if (( rc == 0 ))...
Dr_Emann | 4 years ago | on: Rust in the Linux Kernel (Android Security Blog)
Dr_Emann | 5 years ago | on: Why asynchronous Rust doesn't work
Dr_Emann | 5 years ago | on: Go is not an easy language
Dr_Emann | 5 years ago | on: Go is not an easy language
Dr_Emann | 5 years ago | on: Go is not an easy language
vec.splice(i..i, std::iter::repeat(0).take(length));
This replaces the values in range `i..i` (an empty range starting at i) with `length` copies of `0`.Dr_Emann | 5 years ago | on: State of Rust Survey 2020 results
Dr_Emann | 5 years ago | on: A Defer Mechanism for C
Do you not like the array subscript operator, either, since a[b] can be *(a+b)? How about a && b, you can replace that with (!!a) & (!!b), with an extra 'if' if you need the short circuiting.
Dr_Emann | 5 years ago | on: A Defer Mechanism for C
Dr_Emann | 5 years ago | on: Pointers Are Complicated II, or: We need better language specs
It constructs a pointer to the "one past the end" element, but that is fine, and the original program never dereferences that pointer. Again: there is no UB in the original program.
Dr_Emann | 5 years ago | on: Pointers Are Complicated II, or: We need better language specs
https://c.godbolt.org/z/qe3f4K
`*(&i+1)` dereferences the pointer "one past the end" which is UB.
Dr_Emann | 6 years ago | on: The Art of Command Line (2015)
Dr_Emann | 8 years ago | on: Board games are back, thanks to lessons designers learned from computer games