BB_C

joined 1 year ago
[–] BB_C 3 points 4 hours ago

The most important part of curl is the library, not the CLI tool. And the TLS backend is very much relevant due to varying features supported, different licenses involved, and varying levels of ease when it comes to building and distribution.

That's when you're providing binaries. Otherwise, you would have to be wary of potential compatibility issues with libcurl packages provided by different Linux distributions for example.

See CURLOPT_ECH for a recent and still evolving example of this.

[–] BB_C 24 points 1 day ago

What serious Linux users buy GPUs based on raw gaming performance on release week?

I personally buy based on open-source driver support. And this includes long-term active support, AND developer approachability.

My current GPU is an AMD/Radeon one because of that. But I'm reconsidering my position when my next hardware upgrade comes.

I reported an AMD GPU driver issue to mesa once. It was tested, confirmed, and patched by a competent AMD developer within a few days. Now you have easily reproducible issues like this not even going past the testing phase after many months. And there are similar issues across all model generations.

If I were to upgrade my workstation next year, I would probably go with an AMD CPU and an Intel GPU, which is the exact opposite of my current setup 🙃. One should never rely on outdated perceptions.

[–] BB_C 1 points 1 week ago (1 children)

Another huh from me. Or maybe I'm missing something, because this should all be obvious.

The source of the standard library is a rustup component that everyone should have installed. As for crates, you don't have to manually download any sources. Just add the crate as a dependency, and jump around definitions as much as you like. You can remove the dependency later if you decide to not use it.

[–] BB_C 3 points 1 week ago (3 children)

this wasn’t easy for me to find

Huh! This is the internal ExitCode, and it's two jump-to-definition calls away. The first to get to the public type definition, and the second from the public type's struct field to the private type.

[–] BB_C 4 points 1 week ago (5 children)

ExitCode is a struct, therefore it behaves like a type with many fields which define the types contained in the struct.

That's a bit too off. structs in rust are product types. A struct may define zero or more fields. And fields can be named or not. if not, such structs are called tuple structs.

In the doc page, if you clicked on source, it would have taken you to the definition.

pub struct ExitCode(imp::ExitCode);

That's a public struct with one unnamed private field. The type of the private field also happens to be private/internal.

As for why, usually the purpose is providing type safety, a unified interface,... etc. Notice how for example a windows-only extension trait is implemented that allows converting raw u32 exit codes into ExitCode.

So now you have exit codes possibly sourced from u8 or u32 values depending on the platform. And you need a safe unified interface to represent them.

I hope that's an enough starting point.

[–] BB_C 2 points 3 weeks ago

I would move all struct members from Foo into a “new” Foo and return that?

Yes... if you don't define Drop for Foo.

If you do, then you will have to either use mem::take()/mem::replace() with each field, or if you don't mind unsafe {}, you can just do a trivial transmute. Justunsafe { transmute(self) } should work.

[–] BB_C 2 points 3 weeks ago* (last edited 3 weeks ago) (2 children)

I'm stating the obvious here, but if you have ownership at the time of conversion, then you can just change the type, you don't have to use dyn (a la impl Foo<false> { fn into_debug(self) -> Foo<true> {} }). That may require some code restructuring of course.

[–] BB_C 1 points 4 weeks ago

Yeah, I got that.

I'm asking what would be the benefit of not using a single error enum for all failure reasons?

[–] BB_C 9 points 1 month ago (2 children)

Later: short summary of the conclusion of what the committee didn't do (read 307 minutes)

Fixed that for you.

If you read the post, you will see it explicitly stated and explained how the committee, or rather a few bureaucratic heads, are blocking any chance of delivering any workable addition that can provide "safety".

This was always clear for anyone who knows how these people operate. It was always clear to me, and I have zero care or interest in the subject matter (readers may find that comment more agreeable today 🙂 ).

Now, from my point view, the stalling and fake promises is kind of a necessity, because "Safe C++" is an impossibility. It will have to be either safe, or C++, not both, and probably neither if one of the non-laughable solutions gets ever endorsed (so not Bjarne's "profiles" 😁), as the serious proposals effectively add a non-C++ supposedly safe layer, but it would still be not safe enough.

The author passionately thinks otherwise, and thinks that real progress could have been made if it wasn't for the bureaucratic heads' continuing blocking and stalling tactics towards any serious proposal.

[–] BB_C 7 points 1 month ago (4 children)

I’ll wait for the conclusion of what the C++ committee does

🤣 🤣 🤣 🤣

[–] BB_C 2 points 1 month ago (2 children)
10
submitted 7 months ago by BB_C to c/rust
21
submitted 7 months ago by BB_C to c/rust
view more: next ›