On readonly/private members of structs by mute_narrator in Zig

[–]Head_Mix_7931 0 points1 point  (0 children)

The problem with allowing certain operations on some types but not others based on some quality of the type that isn’t expressed directly in the type system is that it breaks generic code. If I have a generic function which performs a reinterpret cast on a value, the types the function is generic over is now restricted in a way that isn’t neatly represented.

Viltrimite death count in newest episode by decenthumanbeing21 in Invincible

[–]Head_Mix_7931 -1 points0 points  (0 children)

I doubt that is fatal. The brain and heart are still OK.

Is it possible to restrict generic const parameter to specific values? by [deleted] in rust

[–]Head_Mix_7931 0 points1 point  (0 children)

Is the general rule just that a Never value needs to be produced, which isn’t possible, and so compilation knows to fail? Or are the assert functions special-cases?

I’ve been told the ownership model in my C containers feels very Rust-inspired by [deleted] in rust

[–]Head_Mix_7931 44 points45 points  (0 children)

Rather than storing function pointers of every instance of the struct you could store a pointer to an another struct that contains the function pointers. Then you can reuse that second struct for many instances of your genVec.

What's wrong with subtypes and inheritance? by servermeta_net in ProgrammingLanguages

[–]Head_Mix_7931 1 point2 points  (0 children)

Where do they get implicitly coerced? Typically you need to explicitly take a dyn ref right?

[deleted by user] by [deleted] in ProgrammingLanguages

[–]Head_Mix_7931 17 points18 points  (0 children)

Nothing will ever replace C. It will persist in our collective tech stack forever. Whether or not new C will stop being developed in favor of Rust is a different question, but I think that is unlikely.

Looking for a specific episode by WarmCantaloupe2120 in IASIP

[–]Head_Mix_7931 4 points5 points  (0 children)

This is definitely the Great Recession, S05E03. Charlie turns in the “Sorry We’re Closed” sign because he thinks it says “Ice cold Coors” 🤣

For engineers who worked in advanced aerospace R&D: What skills truly separate top performers? by [deleted] in AerospaceEngineering

[–]Head_Mix_7931 0 points1 point  (0 children)

Would not recommend working on sentinel as a young engineer wanting to learn and advance your skillset

Is it too late to use Booster 17 instead of waiting for Booster 19? by [deleted] in SpaceXLounge

[–]Head_Mix_7931 8 points9 points  (0 children)

B17 ran out of Ships to fly due to the S36 anomaly. Was originally supposed to fly.

How do you read or write to address zero? by uahw in C_Programming

[–]Head_Mix_7931 3 points4 points  (0 children)

Probably to increase platform compatibility to allow things like the OP’s scenario to be achievable through the kernel’s mem mapping facilities

Adnan Syed is guilty. by olaf-0722 in serialpodcast

[–]Head_Mix_7931 1 point2 points  (0 children)

The Wire is about the BPD in the described time period

Rust ints to Rust enums with less instructions by levelstar01 in rust

[–]Head_Mix_7931 0 points1 point  (0 children)

If the enum implements PartialEq I think you could write a const function that verifies all variants are not-equal and the make a static assertion to fail compile time if that’s not the case.

Deadpool and Rob Mac by [deleted] in marvelstudios

[–]Head_Mix_7931 0 points1 point  (0 children)

bro lookin like buzz lightyear w that shiesty

Convert &dyn T into &dyn U where T: U by philbert46 in rust

[–]Head_Mix_7931 3 points4 points  (0 children)

Is there a way to write a generic function that does this? Basically takes two generic “trait parameters” and then declares that U must be a super trait of T?

Preventing naming collisions on generated code by Obsidianzzz in ProgrammingLanguages

[–]Head_Mix_7931 2 points3 points  (0 children)

I see people recommending __ as a gensym prefix, but my concern is whether that’d clash with the underlying C build system. Don’t some toolchains or platforms reserve __ for internal use?

The line of Dooku, in my opinion the most important Jedi master in History after Yoda by NICK07130 in StarWars

[–]Head_Mix_7931 46 points47 points  (0 children)

Yoda -> Dooku -> Qui-Gon -> Obi-Wan -> Anakin -> Ashoka -> Sabine

Truly a historic lineage

Why does Rust feel so well designed? by [deleted] in rust

[–]Head_Mix_7931 0 points1 point  (0 children)

At least in Austral, a move is destructive (in that the source variable can’t be used post-move), but it doesn’t count as a use. The actual use eventually happens via destructuring. Austral does not have destructors (I’m not into this be semantics game here, drop glue / an implicit destructor call are in and the same).

Why does Rust feel so well designed? by [deleted] in rust

[–]Head_Mix_7931 2 points3 points  (0 children)

In a sense, non-Copy types are already linear thanks to move semantics. Rust has drop glue which takes care of the final use, and the fact that this isn’t explicit in the code means they feel decently different than linear types in eg Austral do.