Actually, I didn't notice your use of clone() which is even worse.
Here is what I had in mind. One can put the T: Default bound on the wrappers themselves to simplify, or add potentially expensive transformations for non-Default types.
Actually, I didn't notice your use of clone() which is even worse.
Here is what I had in mind. One can put the T: Default bound on the wrappers themselves to simplify, or add potentially expensive transformations for non-Default types.
Using cells in your solution is smelly, when you can simply use two transparent wrappers with Ref or RefMut access, so you have actual compile-time checking instead of janky checking at runtime (which is also not zero-cost).
The allow/deny variants could themselves hold & or &mut references too if we are going with that route. But it all depends on the precise problem OP is having and what is the best workable solution for it looks like.
Can you clarify/expand on what you mean.
Are the other objects of the same type (so are indeed Self)?
Are they in the same Vec or a different Vec or from different Vecs?
Are all the T's in your post the same?
...etc
Thank you for spamming info about a 6 month old model just because it was posted in another instance you don't want people to use.
I replied on-topic there.
There should be a rule against low quality posts.
Vibe-coded trash + outdated models.
Wouldn't have expected anything better from a trash website.
translates to assembly code with a very predictable pattern.
the portable assembly meme
🤣🤣🤣🤣🤣🤣🤣
⚠TRIGGER WARNING⚠ two tokio-rs repos (this and toasty) have AGENTS.md files.
exposed ABI
ABI is not something that gets "exposed" or not.
it will always be ambiguous as implementations are hard to compare across languages
Correct.
in the transition for x86_64 they were seeing up to 70% increase in compile speeds
And that was a part of what I was hinting at, because you get >>70% speed-up with Cranelift in most Rust projects. But in either case, faster code generation is not free lunch, hence the mention of comparable runtime performance of generated binaries.
You know bindgen exists, right?
That has nothing to do with what we were talking about. And in any case:
insanely fast
Needs qualification vs. other languages for binaries with comparable runtime performance.
(Hint: you will be surprised.)
with incremental rebuilds
Not special or unique.
and can watch files for changes
Not only not special, but literally exists in all workable build tools. bindgen+build.rs is the Rust version of this.
a c compiler not just using ffi.
Beyond what amounts to a packaging difference, what does that even mean?
How do you think zero-cost C ABI support (including fully working cross-lang LTO) works in lang implementations that have that? And how do you think that's different from what Zig gives you?