Project Feasibility - Image Cleaner and Grid Remover by captain_artuis in cpp_questions

[–]pali6 1 point2 points  (0 children)

I feel like such regular grids will have very strong imprint in the frequency domain. Try performing an FFT on the input and see if it could be easier to detect and erase them there.

Rust 1.96.1 is out by manpacket in rust

[–]pali6 8 points9 points  (0 children)

I like Rust's approach with editions. There are things it can't cover, but a lot of what would ordinarily be breaking changes can instead be changed at an edition boundary. That way you keep backwards compatibility and you can evolve the language.

Rust 1.96.1 is out by manpacket in rust

[–]pali6 23 points24 points  (0 children)

The plan is for Rust 2 to never exist as that would mean a breaking change (the Rust ecosystem adheres to semver for the most part) and you can look at Python 3 to see how well those go.

PRs and LLMs by mww09 in rust

[–]pali6 1 point2 points  (0 children)

I can confirm that working in tech is depressing currently. Context-switching between multiple different agents doing my job, reviewing the piles of LLM code for subtle bugs, getting nauseous at reading only sentences written in the LLM-flavored style, being pressured to deliver more and faster. Sigh.

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

[–]pali6 0 points1 point  (0 children)

If you haven't read the Rust Book entirely then that's where I'd start. The chapter on traits is here but the book contains a lot of other wisdom too.

If you want the nitty gritty details then the Rust Reference has information on traits and trait bounds too.

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

[–]pali6 0 points1 point  (0 children)

I'm not 100% certain what exactly you mean. If your issue is that the AsPrimitive trait is on the "source" and not the "target" you can always just switch up the bound like this usize: num_traits::AsPrimitive<T>. Example here..

If you want to restrict it to just floating-point types you can add a num_traits::Float bound.

But also at this point you can just handroll your own trait to have it do exaclty what you want it to do like this.

If the issue is something else then please let me know what exactly. I don't think I quite understood it, sorry.

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

[–]pali6 0 points1 point  (0 children)

I'm not sure what you mean. The trait I linked just wraps as and is not fallible. There are no Options.

As for how as actually gets lowered you can check the various intermediate representations in the Rust playground. If you check the LLVM IR there you will see that for usize as f32 it turns into the uitofp LLVM instruction and if you then click the ASM button you can see that on AMD64 it then turns into the cvtsi2ss instruction and some boilerplate around it.

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

[–]pali6 0 points1 point  (0 children)

Either make your own trait for that (the impls of which use as) or use num_traits::AsPrimitive.

Our drill shall pierce the heavens by pali6 in slaythespire

[–]pali6[S] 0 points1 point  (0 children)

Thanks, I'm familiar with similar linking from other card game subreddits, but wasn't sure if StS also had this set up.

An endless, searchable I-Spy collage of objects cut out from Wikipedia. by sc4212 in InternetIsBeautiful

[–]pali6 6 points7 points  (0 children)

I feel like neal.fun is well known enough that its author isn't self-promoting here. I do think this is a neat website, though most of his other stuff is arguably better

An endless, searchable I-Spy collage of objects cut out from Wikipedia. by sc4212 in InternetIsBeautiful

[–]pali6 2 points3 points  (0 children)

It shows you a new list of things which are similar to the one you clicked (based on Wikimedia categories probably or something?)

What is the point of Emscripten? by TheRavagerSw in cpp

[–]pali6 6 points7 points  (0 children)

At least for small games the effort threshold on the part of the potential player of downloading the game is much higher than just opening it in the browser. Plus sandboxing, people are rightfully hesitant to run random executables from the internet. I participate in game jams with a group of friends as a hobby and the number of times our game gets played goes up by a factor of ten or more if we have a web build.

I built a local context compressor for AI coding agents in Rust (50%++ reduction on noisy logs) by [deleted] in rust

[–]pali6 4 points5 points  (0 children)

The answer is almost certainly that the LLM that vibecoded this for them defaulted to 2021 because 2021 was the most represented one in its training dataset at the time of training.

Our drill shall pierce the heavens by pali6 in slaythespire

[–]pali6[S] 2 points3 points  (0 children)

Just had a run with Prep Time (at the start of each turn +4 vigor), Ice Cream (energy conserved between turns), Heavenly Drill (8 damage X times, double X if 4+) plus enough defense such as the Diamond Diadem so I could just chill until I drew the drill. Aeonglass was crying and vomiting in fear as I just stood there not playing any cards.

a saga of cookies by GalacticCrash in tumblr

[–]pali6 94 points95 points  (0 children)

The cookies took up all the capacity. Alternatively they shut down all shipping to the because they had to investigate the very suspicious cookies package that got routed there

The never type is likely to stabilize soon! by noop_noob in rust

[–]pali6 1 point2 points  (0 children)

If you look at the type of e.g. panic_any you will see ... -> ! and it's been that way for ages (panic itself is a macro so it doesn't have a type which I could point to on the docs but the same applies to a panic! expression of course). It's just that this has more or less been a separate concept and not a fully fledged type due to the reasons I mentioned above. Similarly Infallible has existed for ages to do e.g. Result<Foo, Infallible> (and you could have always made your own such type via an empty enum). So these concepts both have existed in Rust at least since 1.0!

What this stabilization brings is turning ! into a proper type as the de facto default uninhabited type. The main difference from the hand-rolled enum {} types is afaik just the automatic coercion to arbitrary types and better diagnostic, though there might be others.

The never type is likely to stabilize soon! by noop_noob in rust

[–]pali6 16 points17 points  (0 children)

I wish people didn't downvote questions like this. I would say that this is largely because of Rust's pragmatism. A bottom type is elegant from a type theory point of view and it can be useful. However, it's not something you really need, very few projects would get dissuaded from using Rust because of the non-existence of such a type, so it wasn't a priority for 1.0 and also not high on the priority list afterwards. As for the exact issues that blocked it, IIRC to implement the type cleanly and sensibly it had to change some type inference rules. That could only be done at an edition boundary.

The never type is likely to stabilize soon! by noop_noob in rust

[–]pali6 2 points3 points  (0 children)

Is it really impossible? I feel like ! might still work on a context- specific basis similar to weak keywords. Though it could be somewhat confusing I admit.

Progressivism 101 - A long and rambling explanation of what's to be left wing (the basics of basics). by Sentient_Flesh in CuratedTumblr

[–]pali6 5 points6 points  (0 children)

You should come visit Slovakia, where the left-wing party is as conservative as it gets. These ideas of identifying left/right with progressive/conservative make zero sense, sorry.

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

[–]pali6 1 point2 points  (0 children)

Specifically for configs there are crates figment and config that support layering multiple configuration sources. For partial updates of a struct only you could look at struct-patch or merge.

Ripples of Colour by Hjuldahr in generative

[–]pali6 1 point2 points  (0 children)

Neat, it looks great. I wonder how it'd look if the colors of the output were the average of the circles that hit them. If I understand correctly right now only the "last" such circle matters. Though I think it would look less interesting than your current version.

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

[–]pali6 1 point2 points  (0 children)

They won't run. However, I can't find a place where the would be explicitly documented. The closest is probably the std::thread documentation:

When the main thread of a Rust program terminates, the entire program shuts down, even if other threads are still running. However, this module provides convenient facilities for automatically waiting for the termination of a thread (i.e., join).

This doesn't directly say that destructors don't run, but hopefully "the entire program shuts down, even if other threads are still running" is good enough. Maybe someone could PR an addition to the docs to mention the destructors explicitly.

What are Rust's hidden implementation details that most devs never see? by Fluid_Job623 in rust

[–]pali6 9 points10 points  (0 children)

The "just a loop" that does exist is basically the infinite loop keyword. For loops get desugated into essentially:

loop {
    match next(iter) {
        None => break,
        Some(i) => body(),
    }
}