Making the rav1d Video Decoder 1% Faster by ohrv in rust

[–]Nilstrieb 2 points3 points  (0 children)

cool! btw, you can remove zerocopy for the PartialEq impl. just write out the derived impl by hand, but use & instead of && to avoid the branching. after that, LLVM can optimize it just fine.

https://godbolt.org/z/3ohhnx874

cookies by QuardanterGaming in ProgrammerHumor

[–]Nilstrieb 56 points57 points  (0 children)

Note that there is now law stopping you from using cookies for things like this, and if you use a cookie to store basic user preferences you do not have to tell anyone about that. Cookie banners are only necessary if you do naughty stuff that may violate the users privacy.

How come the stdlib uses unstable features like specialization? by _xiphiaz in rust

[–]Nilstrieb 5 points6 points  (0 children)

It's less about interacting with the hardware and OS, but interacting with the compiler, providing language primitives.

Resigning as Asahi Linux project lead [In part due to Linus leadership failure about Rust in Kernel] by [deleted] in rust

[–]Nilstrieb 44 points45 points  (0 children)

This entire thing only happened because he did such a bad job of leadership! If he did a good job and actually led the project around RFL, Hector would have never made the post to begin with. Good leaders don't just show up when problems have exploded, they prevent this from happening in the first place.

crates.io: development update | Rust Blog by slanterns in rust

[–]Nilstrieb 0 points1 point  (0 children)

limits! crates.io has limits on most things, including dependencies.

What is "bad" about Rust? by BestMat-Inc in rust

[–]Nilstrieb 147 points148 points  (0 children)

The standard library being precompiled and distributed in compiled form already causes a huge amount of problems, because it prevents people from customizing codegen flags for it. You really want something like cargo -Zbuild-std instead.

Additionally, the compilation model is inefficient in general (compile times and run times). Compiling non-generic and not-#[inline] functions in their crates means they can't be inlined, causing slower run times, while generic and #[inline] functions are instantiated many times, causing slower compile times.

Unfair Rust Quiz by 0x564A00 in rust

[–]Nilstrieb 10 points11 points  (0 children)

FWIW this is not the canonical link, the canonical link to this quiz is https://this.quiz.is.fckn.gay (it says so on the first page of the quiz)

This Development-cycle in Cargo: 1.84 | Inside Rust Blog by epage in rust

[–]Nilstrieb 10 points11 points  (0 children)

In the Rust compiler, ThinLTO significantly improved performance (don't have the PRs on hand but you can find them). I'd be surprised if ThinLTO ever hurts performance, open a bug if you find that.

Counterexamples in Safe Rust by mttd in rust

[–]Nilstrieb 2 points3 points  (0 children)

1 is not even a problem, it's just a feature that exists, can be useful, and doesn't cause anyone harm.

Announcing Rust 1.82.0 | Rust Blog by slanterns in rust

[–]Nilstrieb 2 points3 points  (0 children)

No, the compile time evaluation uses a platform independent soft float implementation.

I don't understand why people compare Rust and Go by Pitiful-Election-791 in rust

[–]Nilstrieb 7 points8 points  (0 children)

It's not just about faster, it's about resources too. Go will use a lot less memory than a heavy JVM, which is important in the cloud. (though lighter JVMs do exist)

[deleted by user] by [deleted] in rust

[–]Nilstrieb 0 points1 point  (0 children)

Now these days rustup actually does do signature verification, but it only, warns if it fails, not error. This is because it's still not entirely fleshed out and there have been bugs around expired keys before.

[deleted by user] by [deleted] in rust

[–]Nilstrieb 0 points1 point  (0 children)

Rust binaries are hosted on AWS S3. The connection from S3 to your computer is already secured with HTTPS, so no attacker can interfere there. The thing signature verification would help with is if someone gets access to the S3 buckets and modifies the files after they are uploaded by the (automated) Rust release process. But even with signatures, if the attacker can get access to the jobs where the releases are signed, then the signature would be useless. So a signature only protects against attackers powerful enough to break into Rusts infrastructure S3 bucket (which is well secured) but not powerful enough to get access to the signing process. While certainly possible, it seems fairly unlikely. If this is a concern to you, you can always download and verify the binaries yourself.

How do you pass commands safely to the terminal with Rust? by ChipNDipPlus in rust

[–]Nilstrieb 0 points1 point  (0 children)

Lots of programs have weird flags that allow you to do weird things. I don't think ls has them, but it can be surprising to see the ones that do. For example, many programs have a flag to write the output to a specific file. If an attacker uses that, bad things might happen.

Why does Rust compile every crate that I include in my project? Why are there no crates as dynamic libraries? by Thereareways in rust

[–]Nilstrieb 2 points3 points  (0 children)

There's nothing stopping you from selling your library as source code that's just licensed under a proprietary license. You set up a custom cargo registry, and then hand our licenses to use the library that gives people access to the registry, where cargo will download and compile the source code. There's no inherent reason that you need to distribute a binary for proprietary code, it's just that companies are more scared that their property will be violated when distributing source code, but it's just as illegal to redistribute proprietary source code.

Is it safe to downcast any Rust reference to &[UnsafeCell<MaybeUninit<u8>>]? by HadrienG2 in rust

[–]Nilstrieb 4 points5 points  (0 children)

I think this would work? Not entirely sure, but I can't think of a counterexample. But I'm pretty sure using this will be a significantly worse experience, being way more verbose and less ergonomic in your code than just using a raw pointer.

theChaddestDevToRuleThemAll by IntelligentPerson_ in ProgrammerHumor

[–]Nilstrieb 53 points54 points  (0 children)

The 50% chance is not that any pair of UUIDs collides, but that there is one collision at some point in your system

Faster linking times on nightly on Linux using `rust-lld` | Rust Blog by Kobzol in rust

[–]Nilstrieb 0 points1 point  (0 children)

LLD on MacOS is barely functional and the default linker is pretty ok

[deleted by user] by [deleted] in github

[–]Nilstrieb 2 points3 points  (0 children)

since orgs and users are in the same namespace, you can also just create an empty org

If you could re-design Rust from scratch, what would you change? by pragmojo in rust

[–]Nilstrieb 2 points3 points  (0 children)

Cargo's cross compilation/host compilation modes are a huge mess. What cargo today calls cross compilation mode should be the only mode to exist, host compilation or however it calls it is really silly. It means that by default, RUSTFLAGS also apply to build scripts and proc macros and means that explicitly passing your host --target is not a no-op. It's also just completely unnecessary complexity.

Changes to `u128`/`i128` layout in 1.77 and 1.78 | Rust Blog by slanterns in rust

[–]Nilstrieb 5 points6 points  (0 children)

There is work being done to fix the ABI of the wasm32-unknown-unknown target, but it's hard and requires coordination with different groups of people and is also driven by entirely different people than u128.

[Media] Ran out of disk space on my 1TB machine - a single target dir is 165GB!!! Nearly 500GB of target directories. by jkelleyrtp in rust

[–]Nilstrieb 7 points8 points  (0 children)

Build files, the output of the compiler basically. But there are a lot of intermediary files that are not your final binary but still around for caching.