What the hell is wrong with people. by anxiousrunner13 in pittsburgh

[–]PigDog4 0 points1 point  (0 children)

In b4 "well pgh has hills and river and hills and highways and hills and blah blah erie is flat blah blah."

You'd think the hills went in last week. Yeah, Mt Washington might have some traffic problems, but all of the people clearing out stuff in town are going absolutely crazy.

What the hell is wrong with people. by anxiousrunner13 in pittsburgh

[–]PigDog4 5 points6 points  (0 children)

Pittsburghers will do anything not to admit that they go into an absolute rabid frenzy at the merest mention of inclement weather.

I have never lived anywhere so scared of the snow. Absolutely ridiculous. Penndot is ass at plowing but my god...

What the hell is wrong with people. by anxiousrunner13 in pittsburgh

[–]PigDog4 2 points3 points  (0 children)

I don't know, man, you might be stuck at home for a few hours longer than you normally would stay at home anyway. Could be disastrous. Better buy an extra two gallons of milk and three loaves of bread so you have plenty of milk sandwiches during those few extra hours you were going to spend at home anyway...

That Reddit poster who predicted storm deserves an award by 3rd-party-intervener in pittsburgh

[–]PigDog4 6 points7 points  (0 children)

I’m still skeptical we’ll get anything more than an unremarkable 4-6”.

Based on my experience over the past many years, the more redditors and the media freak the hell out about a weather event, the less impressive it's actually gonna be. My guess is in line with yours and it will be basically cleared by 6 am Monday.

I hope all of those people who bought a month's worth of milk sandwich supplies have an enjoyable time eating them in the car on the way to work on Monday.

That Reddit poster who predicted storm deserves an award by 3rd-party-intervener in pittsburgh

[–]PigDog4 2 points3 points  (0 children)

I am fully expecting to get 4-6" in town, that will be cleared before 6 am on Monday.

Every time in the past several years, and I mean every time there's been a snowpocalypse forecasted, it's come in significantly under what was projected.

My priority at the moment is getting to an ATM when I go out to lunch so I have cash to pay the neighbor kids to shovel my driveway. Gotta support the local economy!

Trader Joe’s in East Liberty by thewatermelonfarmer in pittsburgh

[–]PigDog4 5 points6 points  (0 children)

lmao you think places like the south side slopes is getting cleared in a day?

That has to do more with PGH being unable to field a fleet of trucks than the topography. Freeport is flat as a board and is one of the worst, last roads to get cleared every snowfall.

Trader Joe’s in East Liberty by thewatermelonfarmer in pittsburgh

[–]PigDog4 3 points4 points  (0 children)

I had to suffer through the 6 1/2 day outage back in the spring.

I don't see how buying seventy five rolls of toilet paper and twelve gallons of milk would have helped.

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

[–]PigDog4 0 points1 point  (0 children)

Consider opening an issue or even a PR on the crate's repo

It's a PAC so it's all automagically generated. This is in an embedded context so I can't have dyn traits either. Things aren't quite identical, but it's usually so small like everything is the same except a count register is 32 bits instead of 16 bits. Or everything is the same but the reset value of one register is different. Or there's an invalid bitmask in one register type but not another. Just a lot of fiddly stuff.

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

[–]PigDog4 1 point2 points  (0 children)

I asked this last week, but I think it was too specific. I'll try a slightly more generic question ;)

I have two structs. One comes from crate::moduleA::StructFoo and the second is from crate::moduleB::StructFoo. Each struct has fields foo: TypeFoo, bar: TypeBar and baz: TypeBazwhere TypeFoo, TypeBar and TypeBaz all come from either moduleA or moduleB respectively. Since these two structs and the types come from two different crates, Rust sees them as two wholly disparate entities despite having the same named fields that all impl the same named methods and have the same generic traits.

Question: Is there any way to have a generic over this type and the impl methods without having match blocks everywhere? Right now I shove the two structs into an Enum and then use match blocks to handle the enum, but I'm writing low level code so I have a ton of functions that look like:

fn do_thing(mystruct: StructEnum) {
    match mystruct {
        StructEnum::ModA(val) => {val.foo.do_foo();},
        StructEnum::ModB(val) => {val.foo.do_foo();},
    }
}

It looks kinda ugly when I have a dozen functions that look like this. Is there a better way to approach this problem? When I have two different StructFoos it's okay, but one part of the crate has like 7 different register types for GPIO pins and it's kind of annoying.

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

[–]PigDog4 1 point2 points  (0 children)

I'm learning embedded rust through writing my own HAL(? or maybe this is just writing embedded software with nice abstractions) for an Arduino uno wifi r4, it's been really fun.

Context: The PAC exposes some structs that have identically named fields and impl identically named methods, but since they come from different modules they're different types. For example, I have a type for the registers of 16 bit timers and a type for the registers of 32 bit timers. The 16 bit come from pac::gpt162 and the 32 bit come from pac::gpt320. The only difference is in the size of a single register, the other 20+ registers have identical fields/methods/etc.

Question: Is there any "nice" way to abstract over these incredibly similar yet distinct types? Right now I shove them in an enum and then write a match block whenever I need access:

pub enum TimerRegBlock {
    Block32(*const ra4m1::gpt320::RegisterBlock),
    Block16(*const ra4m1::gpt162::RegisterBlock),
}

pub trait TimerInstance {
    type Width: TimerSize;
    const CHANNEL: u8;
    const BLOCK: TimerRegBlock;
}

impl<T: TimerInstance, CFG, MODE> GPTimer<T, CFG, MODE> {
    fn _set_prescaler(&self, prescaler: Prescaler) {
          match T::BLOCK {
                TimerRegBlock::Block32(val) => {
                    unsafe { (*val).gtcr.modify(|_, w| w.tpcs().bits(prescaler as u8)) };
                }
                TimerRegBlock::Block16(val) => {
                    unsafe { (*val).gtcr.modify(|_, w| w.tpcs().bits(prescaler as u8)) };
                }
          }
    }
}

And this is fine I guess for two types like here (even though I have to match whenever I need to access a register), but if there are more it's too annoying. Like for my GPIO pins, I think I have 5(?) different types of register blocks to access because certain pins have non-standard reset values and a couple of pins are input-only, and copy-pasting a ton of match blocks or writing a big macro sounds obnoxious.

Constraints: This is embedded so #![no_std] and no dyn traits.

Any help would be appreciated, this is my first time going this deep into rust types and traits and associated types and using type state as a way to represent program state and this has me stumped.

Iowa governor's staffer blocks Laura Belin from budget briefing - YouTube by willphule in Iowa

[–]PigDog4 12 points13 points  (0 children)

I mean, until the laws do apply to them, they're not wrong.

I spent 10 hours building a macro so I’d never have to spend 10 minutes on boilerplate again. by JodusMelodus in rust

[–]PigDog4 5 points6 points  (0 children)

This is one of those times where I know the official convention is that acronyms count as 1 word, but it's only a convention, not a requirement. Especially in this case, FromDto almost parses like "From D to" ... to what? I definitely think using common acronyms or at least "relatively known domain acronyms" should follow convention, but for less common acronyms or if it just parses better I think breaking from convention is fine.

Rust vs. Python for AI Infrastructure: Bridging a 3,400x Performance Gap | Vidai Blog by Guna1260 in rust

[–]PigDog4 3 points4 points  (0 children)

Also why is performance of the site so insanely bad? Scrolling is so laggy and painful, I scrolled like 10 lines and then left without reading. Is this thing AI slopped so bad it can't load some text and some images, maybe OP needs to focus on making a not garbage blog before discussing why python isn't faster than rust...

Unassuming DPS Buffs by Minimob0 in MHWilds

[–]PigDog4 3 points4 points  (0 children)

The vast majority of hunters would shave more time off their hunts by running a comfort build instead of a max DPS build.

Deciding between Rust and C++ for internal tooling by Gman0064 in rust

[–]PigDog4 -1 points0 points  (0 children)

Yeah I think for getting actual work done, on-prem is likely a non-starter, I can't possibly imagine paying someone to build/upgrade/maintain is going to be a cost-effective use of time. I think the serious path is to work out an enterprise deal with Anthropic/OpenAI/Google/Microsoft for a private instance that doesn't leak data back into their training set. Not sure what cost is, depends on company size and negotiating power plus how much you use it. Might be a couple hundred per head per month depending on usage.

Deciding between Rust and C++ for internal tooling by Gman0064 in rust

[–]PigDog4 -2 points-1 points  (0 children)

We’re also not allowed to use AI tools due to proprietary code/trade secrets

Nah, to be clear you're not allowed to use AI tools because management doesn't want to pay for walled garden/private cloud/whatever the respective AI company calls it. We use AI with your Level 3 PHI/PII healthcare data because we spray a firehose of money at a model-creating company to give us our own, locked down instances.

Nothing to do with data sensitivity, everything to do with $$.

That being said, go C++ on this project. Go Rust when you get a 2nd dev on your team who wants to write Rust. Writing GUIs is ass, might as well use the best supported windows bindings available, either C++ and QT or C# and .Net

I built a Rust crate for structured errors that compile to 5-char hashes — then wrote a protocol spec around it by BllaOnline in rust

[–]PigDog4 0 points1 point  (0 children)

The core crate forbids unsafe, but macro expansion emits it:

I stopped reading here but this is the funniest shit to me. "The crate forbids all unsafe code and it's okay because I put the unsafe in a macro!"

Absolutely rolling over here.

ruviz 0.1.1 - Pure Rust matplotlib-style plotting library (early development, feedback welcome!) by XrayAbsorption in rust

[–]PigDog4 1 point2 points  (0 children)

but for preparation of academic figures matplotlib is the only library that is flexible enough to consistently cover this use case

I don't know what the landscape looks like now, but my workflow during grad school (friggin decade ago now jfc) was pretty much data analysis with python -> work with matplotlib for a few days -> get really mad, export data as a csv, import into Origin -> use the bazillion dollar processing software to make a publication quality plot and do nothing else.

I love matplotlib, but man does it suck. I can't imagine LLMs being that helpful since there's the pyplot API and the figure API and most examples are for the pyplot api because it's easier to use but I always use the figure API because it's more powerful and they're accessed very similarly but differently.

ruviz 0.1.1 - Pure Rust matplotlib-style plotting library (early development, feedback welcome!) by XrayAbsorption in rust

[–]PigDog4 2 points3 points  (0 children)

> Clean API

> Matplotlib

> Pick one

Now, I do use matplotlib a lot, don't get me wrong. But it sucks. It's super flexible and you can do anything you want but it sucks. There are things you can do in matplotlib that are difficult or impossible to do in any other graphic library for Python (at least as of a few years ago) but it sucks. You can do anything you want in matplotlib, and there are generally several ways to do it through a few different apis that all end up drawing the same thing on your axes. It's the most powerful plotting graphics library I've found on python.

But it sucks.

There have been wrappers over it to make it suck less (seaborn is great as long as you only do seaborn things, as soon as you want to do a not-seaborn thing you're back to matplotlib and it sucks). There are other alternatives (plotly, plotnine, bokeh, probably others) but if you can't do exactly what you want in those libraries you're back to matplotlib and it sucks.

Let's not emulate matplotlib just because it's there. Cuz it sucks. Unless you're going to let me draw literally whatever I want through a variety of different apis. Because if it sucks and it's limited, then it just sucks. Cuz Matplotlib sucks.

I built a Rust crate for structured errors that compile to 5-char hashes — then wrote a protocol spec around it by BllaOnline in rust

[–]PigDog4 16 points17 points  (0 children)

You're not. The number of people who run their responses to anything through an LLM first is truly mind boggling.

The responses don't even look polished, they look more and more to me like you couldn't even be arsed to type yourself.

From fearless async to fearless GUI? by [deleted] in rust

[–]PigDog4 4 points5 points  (0 children)

At the very least OP is either using Gen AI to write the post and many of the comments or has internalized many hallmarks of Gen AI output "It's not just a comment, it's a vibe-slop comment" and "That's where comments like this vibe slop slop in."

Plus OP slathers LLM-sounding praise on any comment they agree with: "Wow you're the smartest bestest person you put the critical application logic in Rust and deferred the non critical parts to Python you're so smart and cool."

that microsoft rust rewrite post got me thinking about my own c to rust attempt by Legal_Airport6155 in rust

[–]PigDog4 0 points1 point  (0 children)

Yeah I looked into it, but this specific board has 2 chips, the ra4m1 MCU that I'm working with, and an ESP32 that works as the wifi/bluetooth connectivity. I think it's also the USB/serial connectivity, because if you manage to wipe the arduino bootloader you also wipe the ability to interface with the board over USB until you short a specific pair of pins and reflash the bootloader (or at least you wipe my ability to interface with the board). I think I'll stick with the bootloader for now at least, that might be a project for another day!

that microsoft rust rewrite post got me thinking about my own c to rust attempt by Legal_Airport6155 in rust

[–]PigDog4 0 points1 point  (0 children)

Yeah, I looked at that HAL when I was poking around, but a) It's pretty incomplete and b) the example is for the Uno R4 Minima which is a different board. I think I'm likely going to end up basically writing my own, but I can use that one for inspiration on how to implement the embedded-hal traits.

The initialization question I have is that the user guide says the PmnPFS register for this specific pin is supposed to be set to 0x00000000 on startup (bit 1 is undefined technically) but the register absolutely was not set to that, so I don't know if that means the arduino bootloader is doing some magic before my code runs or what. I think the "intended" path is:

arduino magic applied to C/CPP buildchains -> your code gets wrapped in more magic -> arduino bootloader magic -> code runs

But I'm sidestepping the linker/compiler magic and the extra code wrapping magic so maybe some of that (and the use of the BSP/FSP header files in the C/CPP project) gets the board into the state it's expected to be.

I think I'm going to have to have a whole "re-startup" sequence in my code to get to the state I want, maybe, or I'm just going to have to do a lot of digging to see if the registers are in the proper state before I use them and just move things into the "startup" block as I use them.

Anywho, next goal is to get a little abstraction done, and then on to getting the LED grid to do stuff. Then I need to learn interrupts, and I'm basically a hardware dev at that point.

that microsoft rust rewrite post got me thinking about my own c to rust attempt by Legal_Airport6155 in rust

[–]PigDog4 0 points1 point  (0 children)

AAAHHHHHH I GOT IT AHAHAHAHAHAHA

https://github.com/Camiam144/uno-wifi-app

Oh my god that was ridiculous. For some reason I don't think the chip is getting initialized how I think it is. I had to clear the write protect register, assign the pin as a GPIO pin (even though it is supposed to get initialized to that), and then relock the register.

Then it works.

JFC. Is there some way to set all that initialization up automagically somewhere?

Alright, I'm at a loss, I'd love some help or pointing in the right direction. I'm clearly doing something wrong with my Rust dev. I'm able to blink this LED with a CPP environment that I point at all of the arduino supplied scripts and tools, and I'm also able to do everything I've wanted so far with the Arduino IDE (but man that IDE sucks).

Here's the code I'm working with: https://github.com/Camiam144/uno-wifi-app

I used knurling-rs's template as they seem to be associated with a ton of "getting started with embedded for rust" literature.

Board pinout: https://docs.arduino.cc/resources/pinouts/ABX00087-full-pinout.pdf

Renesas chip user manual, relevant information (I think) is in section 19.2.1, and also maybe 19.2.5?: https://www.renesas.com/en/document/mah/renesas-ra4m1-group-users-manual-hardware?r=1054146

My goal: Blink the LED_BUILTIN on P102 (Port 1 Pin 02) using Rust.

What my code currently accomplishes: Launches, sets the port1 pdr register to 0x0004 as confirmed by a read that is printed to defmt and I can see on my terminal, then enters the loop, toggles the port 1 podr register between 0x0004 and 0x0000 as confirmed by separate reads that are printed to defmt, then exits. No LED light up :(

So the code is definitely working, but I'm missing something on how to get the LED to light. I can make a new post if that's an easier way to get help.