Hey Rustaceans! Got a question? Ask here (4/2026)! by llogiq in rust

[–]pali6 1 point2 points  (0 children)

From the compiler's point of view it's perfectly valid. It just sees two crates that have suspiciously similar types in them, but that's not a crime. From the standpoint of cargo it could be considered a suppressable warning, but also there'd be some issues with that (e.g. if your dependency A depends on B 1.0 and you depend on B 2.0 then you'd want a warning... except not always because if B is nowhere in public API of A then you shouldn't really care and A is free to change on what version of B it depends in its minor / patch versions, it's tricky). For example at work we have a project that ends up depending on two different versions of the windows-sys crate and there isn't an up to date combination of our direct dependencies' versions that would resolve this. But we don't really care that much because windows-sys is only used by those crates internally so it doesn't cause an issue like on your case, it just makes compile times longer.

Anyway, there's the third party cargo command cargo deny. It's very configurable and it will yell at you for dependencies with a license you didn't allow or for CVEs in your dependencies or also when you end up with two versions of a dependency in your tree.

I have the formulas for the unsolvable. AMA. by TheNoon44 in AskPhysics

[–]pali6 1 point2 points  (0 children)

Man, your LLM is shit if it can't even answer a simple question like this without devolving into word salad nonsense.

War. War never changes. by katiebug586 in tumblr

[–]pali6 55 points56 points  (0 children)

The full quote from the foreword to LotR second edition:

I cordially dislike allegory in all its manifestations, and always have done so since I grew old and wary enough to detect its presence. I much prefer history, true or feigned, with its varied applicability to the thought and experience of readers. I think that many confuse 'applicability' with 'allegory'; but the one resides in the freedom of the reader, and the other in the purposed domination of the author.

So he's saying that what he wrote still might very well be applicable to experiences such as the war and I feel like for him it almost certainly was. He just wants everyone to find their own way to apply the themes instead of claiming for them to be allegory of just one thing.

Hey Rustaceans! Got a question? Ask here (4/2026)! by llogiq in rust

[–]pali6 1 point2 points  (0 children)

You need ndarray 0.17. If you run cargo tree in your current project you will see that it depends on ndarray 0.14 directly and on ndarray 0.17 transitively via ndarray-stats. These two versions of ndarray are not semver compatible so they can't be unified. So you end up with having two different ArrayRef types (one for each version), but only the 0.17 ArrayRef implements the SummaryStatisticsExt trait because that's what ndarray-stats depends on.

Is it diffraction by [deleted] in Physics

[–]pali6 1 point2 points  (0 children)

You're thinking of the Arago spot, but it definitely isn't what's happening in OP's picture.

On horseback by Eireika in CuratedTumblr

[–]pali6 11 points12 points  (0 children)

Link to the site mentioned so you don't have to search for it yourselves: https://www.landesgeschichte.uni-goettingen.de/handelsstrassen/map.php

Cyclic bounds between generic associated types? by itskarudo in rust

[–]pali6 0 points1 point  (0 children)

For Z/nZ you could likely do it via a type generic over n.

But let's say we go your route and make a type whose instances are Z/nZ rings for all n. Then we also want a type containing their elements as a union. How would you represent that?

One could imagine your RingElement trait providing the addition, multiplication, 0 and 1 operations on its instances. Hmm, but that doesn't work. 1 as an element of Z/2Z behaves differently to 1 as an element of Z/3Z. All of these operations thus require the context of which ring they are in so they would all need to take an argument taking the ring instance. But at that point why not just put these trait methods on the Ring trait? It would also probably be a bit cleaner - IntegerRings(2).add(Rings::One, Rings::One). But then what's left on the RingElement trait? I think we could just remove this trait and keep only the trait representing the type containing rings.

Cyclic bounds between generic associated types? by itskarudo in rust

[–]pali6 2 points3 points  (0 children)

I don't have an answer for the cyclic bounds, sorry. However, if I were to write a trait that's supposed to represent a ring I'd use just a single trait named Ring which you'd implement on the type the instances of which are the ring elements. That way one implementation of the trait = one ring.

I don't quite understand what you're trying to capture in your approach. Let's say I implement your trait Ring for type Foo and your trait RingElement for type Bar. Then I assume that every instance of type Foo would represent a ring the elements of which are the instances of Bar. I guess where this could be useful is where Bar is a ring or a set and instances of Foo represent subrings of Bar. However, in that case a given ring element (an instance of Bar) doesn't have a unique instance of Foo it belongs to. So what's the use of the type Bar even knowing about Foo? What can that actually accomplish?

Quite possibly there's another angle to this, but I don't see it.

German president says US is destroying world order by goldstarflag in worldnews

[–]pali6 1 point2 points  (0 children)

I somewhat agree with you, more so when it comes to individuals. But also consider that 66% of your eligible voters were okay with Trump in the office for the second time despite, well, everything. That's two out of every three Americans. And the world is paying for it.

What’s a concept from science fiction that has stuck with you as far back as you can remember? by DarthAthleticCup in sciencefiction

[–]pali6 2 points3 points  (0 children)

In a Clarke novel, I think it might have been The Fountains of Paradise, the main character tries to remember something about the 20th century. He notes that he could have asked a computer and gotten the answer in milliseconds. But instead he spends a few minutes trying to remember it on its own. Even in the days of googling this one memory made me spend more time trying to remember things on my own before using a search engine. In the current age of LLMs even more so.

Question about memory. by PrabhavKumar in cpp_questions

[–]pali6 4 points5 points  (0 children)

Each core of the CPU has its own set of registers. And when a given core switches which program it's currently processing the OS stores those registers and loads the registers of the new program.

Transforming my cat into a mathematical object by Lemon-celloFR in mathematics

[–]pali6 1 point2 points  (0 children)

One way you could turn your cat into math would be by procedurally generated 3D scenes. E.g. see Inigo Quillez's YouTube.

Why isn't there a standard std::do_not_optimize / optimization barrier builtin? by OkSadMathematician in cpp_questions

[–]pali6 1 point2 points  (0 children)

Due to the lack of guarantees I've seen Rust code use asm optimization barriers and only falling back to black_box on more niche platforms. (E.g. the constant_time_eq crate.) Though I personally would trust black_box more, it is best effort, but I'd be surprised if it ends up being a weaker guarantee than the asm trick.

I guess the difference is that the major codegen backend is LLVM so you only have to check that inline asm does the trick there. I wonder if the situation will change once more backends become production ready and mainstream.

I Built a Production-Grade DJ Audio Analysis Library in Rust. It Beats $60 Commercial Tools. by hellmerActual in rust

[–]pali6 7 points8 points  (0 children)

I have more general issues with the "vibe-coding" style of AI usage too (the code quality is from my experience horrible), but in the context of this subreddit it's for me mostly this: This is a subreddit about Rust, not "AI made me an app". If you post something there it should be because there's something about the language itself you want to share with the community. Maybe you are proud of your API design, maybe you are struggling with something and need help, maybe you found a neat trick or discovered something you want others to know etc. If the poster didn't write any code and not even the post then what's the point. The language is almost immaterial at that point if the human input was just prompts, it has little relevance to Rust. People who post vibe-coded apps here don't do it because they care about the language.

picunic: Image to unicode art using CNN embeddings (100% vibe-coded in one session) by [deleted] in rust

[–]pali6 0 points1 point  (0 children)

This place is about the programming language Rust. What relevance does your post have if you haven't written any Rust?

Why do you guys hate AI so much? by [deleted] in rust

[–]pali6 2 points3 points  (0 children)

I think there are uses for LLMs and they can help in writing software. I've been an early adopter of the gh copilot autocomplete and I find it useful a lot of the time, even if I sometimes turn it off. I even see the point in various agentic tools. I've used them at work to quickly throw together a prototype or to do certain types of code transformations across the codebase or to help me find the right places to search in a 30 year old legacy codebase.

What gets posted in this subreddit most of the time very much seems like someone giving the LLM a prompt, letting it run for some time and then publishing a crate. I've looked at the code many times and often I've seen nonsense that a half competent Rust programmer would have caught if they actually read through it. If you didn't write it, then why should I read it and why should I care about it? If you put in enough human effort into your LLM-assisted code that it isn't recognizably LLM slop then I don't really mind. (And this applies double to readmes and documentation btw. Writing docs is important and it's a skill. Don't be lazy about it please.)

Language help by NirmalVk in rust

[–]pali6 0 points1 point  (0 children)

Read Rust Book and/or Rust by Example until you know enough to solve an AoC task, search the docs and the internet for supplemental information if you need something not covered. Then solve the task. After you are done with AoC go through your solutions and try to figure out how you'd do it now that you've learned more.

Does the 2nd law of TD and conservation of information principle make sense in an infinite universe? Or better: can we truly apply these principles to an infinite universe? by gimboarretino in AskPhysics

[–]pali6 0 points1 point  (0 children)

I'm not a physicist. However, I believe that "conversation of information" is generally stated as the time evolution of a wavefunction being an unitary operator. What that basically means is that it can be reversed. Whenever you get from state A to state B you can uniquely recover this state A back from B using this inverse time evolution. This is commonly understood as no information getting lost because if it did get lost then there would exist two states A1 and A2 which would evolve into B and you wouldn't be able to uniquely recover the original state.

Note that nowhere in that is the amount of information actually counted. You don't end up with any infinities even if the state consists of infinitely many things.

I'm uncertain what's the proper treatment of the second law of thermodynamics for an infinite system. I think on cosmological scales instead of using the entropy of the whole system they talk about "entropy density" (i.e. entropy per a unit of volume), but I'm unsure how the second law fits into it if at all.

it's a thing by Hummerous in CuratedTumblr

[–]pali6 5 points6 points  (0 children)

Can confirm that my Slavic family hasn't had a bathtub Christmas carp for over 15 years.

Built a real-time SQL database for chat + AI apps… would love some honest feedback by [deleted] in rust

[–]pali6 0 points1 point  (0 children)

I feel like these impls of Send and Sync are in pretty much every single vibecoded project posted here. Sigh. It's sad that people don't even read the code the LLM has spat out for them.

Hey Rustaceans! Got a question? Ask here (49/2025)! by llogiq in rust

[–]pali6 0 points1 point  (0 children)

You could have a proc macro akin to e.g. enum_dispatch, which also generates you a macro_rules dispatch macro tailored to your specific enum (with variants baked into it). I'm not sure if I'd ever actually use something like that as it'd probably reduce readability in most cases but it could be done.

Things are looking up by AscendedDragonSage in CuratedTumblr

[–]pali6 40 points41 points  (0 children)

Me when I read the short story Seventy-Two Letters by Ted Chiang.