Post the original code to !rust@programming.dev and point to where you got stock, because that AI output is nonsensical to the point where I'm not sure what excited you about it. A self-contained example would be ideal, otherwise, include the crates you're using (or the use statements).
why gcc couldnt do this automatically? i mean its supposed to do this right?
Because gcc is a compiler, not a build tool.
Maybe you come from a language where the two tasks are combined, but that's not the case here.
and another important issue that clang ls (language server) showed the same error? i thought fixing this would fix that too, but that isnt the case here.
For the same reason stated above, clangd needs to know how you build your code. This is done via a JSON file called compile_commands.json.
In your trivial case, running this should be enough:
I for one am happy we’re getting an alternative to the Chrome/Firefox duality we’re stuck with.
Anyone serious about that would be sending their money towards Servo, which resumed active development since the start of 2023, and is making good progress every month.
I would say nothing but "Good Luck" to other from-scratch efforts, but It's hard not to see them as memes with small cultist followings living on hope and hype.
P.S. Since it wasn't mentioned already, look up cgroups.
Back when I had a humble laptop (pre-Rust), using nice and co. didn't help much. Custom schedulers come with their own stability and worst-case-scenario baggage. cgroups should give you supported and well-tested tunable kernel-level resource usage control.
Because it's an overhyped joke successfully utilized by crypto scammers.
Neither content addressing, nor distributed hash tables (or key-value stores, or whatever) were novel ideas.
The combination of the two is not a novel idea.
For p2p, torrents, work as another user already pointed out (initial realease 2001).
For a distributed filesystem, look at Tahoe-LAFS (initial release 2007).
For a full anonymous p2p distributed filesystem, check out (real) Freenet, called Hyphanet now (initial release 2000).
And no, if you need anonymity, an anonymous transport (e.g. using libp2p) is not enough. You need to consider anonymity at each step like Freenet does.
These are three real non-overhyped products one can draw inspiration from. IPFS? not so much.
You can look around for more examples. I always found this Wikipedia page about file sharing in Japan interesting, since it mentions networks not well known to the rest of the world:
https://en.wikipedia.org/wiki/File_sharing_in_Japan
// Add `as_cstr()` to `NixPath` trait first
let some_or_null_cstr = |v| v.map(NixPath::as_cstr)
.unwrap_or(Ok(std::ptr::null()));
// `Option::or_null_cstr()` for `OptionᐸTᐳ`
// where `T: NixPath` would make this even better
let source_cstr = some_or_null_cstr(&source)?;
let target_cstr = target.as_cstr()?;
let fs_type_cstr = some_or_null_cstr(&fs_type)?;
let data_cstr = some_or_null_cstr(&data)?;
let res = unsafe { .. };
Edit: using alternative chars to circumvent broken Lemmy sanitization.
Moving (movable/sendable) data is not limited by number or direction, you know. And that second one even makes use of them great Hoare channels! And gives us control on how long we hold on to data before sending it back (modified or not). But I digress. Let's go back to the important talking point that Hoare was right!
Post the original code to !rust@programming.dev and point to where you got stock, because that AI output is nonsensical to the point where I'm not sure what excited you about it. A self-contained example would be ideal, otherwise, include the crates you're using (or the
usestatements).