Is there a tool for automatically transpossing my module structure?
So you consider that inquiry why Python is used is off topic? Are you serious?
Posts from every feed QUEST has found across the web — blogs, news, podcasts, channels and more.
Latest posts
So you consider that inquiry why Python is used is off topic? Are you serious?
well it is related to the python script
The reply providing a python script to do the thing OP wanted was the second reply. Everything after discusses whether rustaceans like python, and whether python is used in rust's build system, which is entirely irrelevant.
mordecai.brain.leak: There will only ever be one instance of StateVector in existence for the life of the program. This requirement, all by itself, implies some amount of global state, i.e. a static item. The sole instance of StateVector is constructed at runtime, so any reference to it will either be None (if referenced before it is constructed) or a valid StateVector. Okay, so you need some kind of (checked) interior mutability. If it were just initializing once, then you would use a…
HJVT: This discussion is entirely off topic here, The topic says - Is there a tool for automatically transpossing my module structure?. Python can be such tool, especially because it is used even for building rustc. Sometimes people do not understand what's topic about, but it isn't their fault.
Apparently I've been playing a game with myself to see how many times I can answer my own questions in the process of figuring how to phrase them correctly enough to be understandable. Regardless, I still haven't found a firm 'does this exist' in my efforts this time, so I thought it might be worth posting to ask. The thought is that it would be convenient for my purposes to have a struct, say StateVector, that holds some arbitrary number of values or sub structures, that: There will only ever…
Thank you very much for the advice; it’s really helping me to improve the website. The plan is to start creating content and see how it goes. Thank you for visiting my website, checking it out and taking the time to write
The process of building rustc itself still relies on a few python scripts. This discussion is entirely off topic here, though.
Just checked, I'm currently on rustc 1.98.0-dev It's probably already Python free. But I do not see a harm on using Python for one time development tasks, as it was pointed in the thread.
Shifts have been around for so long in the language that they probably predate the design philosophy that would prefer a cast there. The language wasn't always quite as explicit, and even to this day some people still are surprised by the lack of integer promotion in other places. Presumably back in the day somebody decided that avoiding casts when computing shifts was worth the potential confusion. I can't find anything in github after a cursory search for it, though. Constant negative shifts…
khimru: For the value that doesn't exist at compilation time? How would that work? I meant rust rejects u8 + u32, u64 - i8, etc even if it could be correct at runtime, It's strange to me that it doesn't reject bitshifting by a integer type of different signedness.
miro: Rejecting code at compile time has no runtime cost, Right operand is not constant in shift. Language where it have to constant is not Rust. miro: The compiler can just issue a error for "you're shifting by i32, that needs to be a u32/u64". For the value that doesn't exist at compilation time? How would that work? Even u32/u64 may overflow…
khimru: ou would need to add check to every place where shift is used. And shift is incredibly common and cheap operation. What makes sense for slow division is not the right fit for shifts… Rejecting code at compile time has no runtime cost, The compiler can just issue a error for "you're shifting by i32, that needs to be a u32/u64".
Because, again, it's wouldn't be work of compiler. You would need to add check to every place where shift is used. And shift is incredibly common and cheap operation. What makes sense for slow division is not the right fit for shifts…
another question: given that negative bitshifts are always incorrect, why doesn't the compiler just reject them the same way it rejects every other case of mixing different integer types
Because adding special code to thousands of places where you don't need it to make someone use in one place where it's desirable is simply not worth it. I think only ARM implements it like that and then only in one very obscure instruction while normal shifts don't work like that.
I'd expect 1u64 >> -1i32 to return 2, moving right by a negative distance is just moving left, but instead it panics. Playground: Rust Playground
Funny enough, I had the exact same thought while reading the first paragraph of your message. An opt-in "bot" flag would be incredibly useful, but it definitely feels like an utopia. The people running mirroring services or research crawlers are probably not going to bother adding a special flag to their automated requests just to be nice. I was actually thinking that a User-Agent approach might be more practical. If crates.io could distinguish between something like Cargo/1.85.0 (organic) and…
This is normal (unfortunately). I don't know what the exact cause is, but my guess is that there are a bunch of organizations mirroring everything on crates.io. Backup/archive purposes maybe. I've seen a few people mention that they are doing research on crates.io, so that might be a few of them. Like I said, I don't actually know, but just be prepared for this behavior when you publish a new crate. I once suggested that there should be an opt-in "bot" flag that would simply cause the download…
I started out with CLI tools; I really enjoy working with Linux, although I should take a closer look at your approach – it’s not just about studying something for the sake of it without a clear focus.
Thank you very much for clarifying that; I forgot to explain that bit.
Okay, so I published this crate called closed about a week ago. It's basically std::function for Rust if anyone's curious. I haven't done any marketing at all — no Reddit, no Twitter, zero. Just pushed 8 versions fixing stuff up. Right now it's sitting at around 2.5k total downloads. But then I looked at the crates.io stats and saw this: Out of nowhere, I got ~1'600 downloads in a single day on Nov 7th. It's a nearly vertical line. I know docs.rs and regular CI pipelines pull crates, but they…

You could have a global collection of leaked dyn ZST arcs for each type then try to get a arc from the collection before allocating a new one.
I could imagine a version of Arc that always reports a fixed count for ZSTs, like what we do for Vec::capacity, and if it's not needs_drop then the existence of clones or not doesn't matter. It's not something an external crate could produce as a "real std::Arc" though. Such an Arc would also not be able to maintain proper ptr_eq connections among clones.
Where would you keep the reference-counts if not on the heap? Arcs don't have a bounded lifetime (that's kind of the point) so any clone can outlive any other one and yet the count has to be kept somewhere.
marlez: to so openly (if not brazenly) reduce the whole of the people inhabiting this forum, into some AI-rotten marketing-speak garbage like "swarm intelligence" It may also be reducing us to a swarm of birds, boids, or even protozoa, so it does not necessarily have anything to do with AI.
cargo init will turn your working directory into a cargo project, make sure you are in the correct directory before running it, you don't want to accidentally turn your ~/Documents into a rust project.
All you need to do is create a project using `cargo`; the `cargo init` command will generate the entire structure you need. This command creates the necessary directories for you. You can also use `cargo new `; this command creates a new project and the folder structure. After creating the project with `cargo`, use this command: `cargo run`; this will get everything ready.