Readit News logoReadit News
jamesmunns commented on Interfaces and Traits in C   antonz.org/interfaces-in-... · Posted by u/ibobev
jamesmunns · 24 days ago
Speaking as someone familiar with C and Rust (not so much Go!), although there's a parallel here to Rust's Traits, this actually is much closer to dyn Trait in Rust, which uses vtables and runtime polymorphism, rather than "regular" Traits in Rust, which are monomorphized versions of similar interface constraints, much closer to C++'s templates (or concepts, I'm hand waving here).

This isn't necessarily a negative, sometimes you actually prefer vtables and runtime polymorphism for various reasons like flexibility, or code size reasons. Just wanted to add some flavor for folks that aren't as familiar with Rust, that this isn't exactly how things usually work, as "regular" Trait usage is much more common than dyn Trait usage, which you have to explicitly opt-in to.

jamesmunns commented on Embassy: Modern embedded framework, using Rust and async   github.com/embassy-rs/emb... · Posted by u/birdculture
the__alchemist · a month ago
This is at the center of a friction point in embedded rust: most of the OSS ecosystem has shifted to this framework, and as a result, is incompatible with, or is high friction if you don't want to make your firmware and control flow Async. This is notable because Rust embedded is nascent and small, so I think splitting the ecosystem along with Async is not ideal. It's also confused some people new to embedded: I regularly hear this dichotomy: "Async vs blocking"; the assumption being if you are not using Embassy, your code blocks the CPU when waiting for I/O, etc.

If you enjoy Async PC rust programming, I think this will be a good starting point. I like how it has unified hardware access to different MCUs, and its hardware support for STM32, for example, is a step up from the initial generation of Trait-based HALs. I seem to be the odd one out as an embedded rust programmer (Personally and professionally) for whom Async is not my cup of tea.

jamesmunns · a month ago
As others have mentioned, ~all of the embassy HALs support nearly 1:1 parity of blocking interfaces for drivers next to the async ones. You really can avoid async entirely while still using embassy hals. The ecosystem is not tightly integrated/locked in.

Even data structure libraries, like embassy-sync, all have `try_` methods, which would allow for polling usage outside of async.

There's no mandate to use async - and helping folks that DO see value in it (which is a LOT of folks), isn't "splitting the ecosystem" - it's people doing things the way they like to do it. Embassy still works very hard to support folks who DON'T want to use async, to avoid duplicated work. There's nothing stopping you from preferring to write and maintain your own HALs, I know you have been for a while! But it's not something that people necessarily have to do, even if they aren't interested or don't prefer async!

jamesmunns commented on From Rust to reality: The hidden journey of fetch_max   questdb.com/blog/rust-fet... · Posted by u/bluestreak
tux3 · 5 months ago
This blog sent me into a memory models rabbit hole again. Each time I end up feeling like I'm finally starting to get it, only for a 6 line litmus test with 4 loads and 2 stores to send me crashing back down.

It makes me feel a little better reading about the history of memory models in CPUs. If this stuff wasn't intuitive to Intel either, I'm at least in good company in being confused (https://research.swtch.com/hwmm#path_to_x86-tso)

I actually knew about fetch_max from "implementing" the corresponding instruction (risc-v amomax), but I haven't done any of the fun parts yet since my soft-CPU still only has a single core.

jamesmunns · 5 months ago
If you haven't seen it, Mara Bos' "Rust Atomics and Locks"[0] is an excellent book on this topic, even if you aren't particularly interested in Rust.

[0]: https://marabos.nl/atomics/

jamesmunns commented on Objects should shut up   dustri.org/b/objects-shou... · Posted by u/gm678
jamesmunns · 6 months ago
In safety industries, particularly aviation, "alarm fatigue" is a really big deal. You recognize that pilots have limited situational bandwidth, and you REALLY don't want to be bugging them about things you can avoid. I worked in collision avoidance systems (TAS/TCASI/TCASII), and spent nearly a whole year just working on figuring out when and how we could avoid warning pilots in cases where "we're not sure exactly what is going on, so tell the pilot just in case" could potentially annoy pilots in cases like take off and landing (where they have important OTHER things to be doing!)

It's a fun balance between "possibly don't warn the pilot about something they should know about", and "don't warn them if they are busy doing something important".

More devices should have a "squelch" switch!

jamesmunns commented on Show HN: Interactive pinout for the Raspberry Pi Pico 2   pico2.pinout.xyz... · Posted by u/gadgetoid
mrheosuper · 7 months ago
I wish many manufactures would begin adding Pin mux inside MCU, like espressif. So most of the time you don't care which pin has which function, and make designing pcb for it much less painful.
jamesmunns · 7 months ago
Nordic's nRF family is the major other vendor I've seen doing this, almost all peripheral can be on any pin. It's definitely a big help for designing boards.
jamesmunns commented on Ask HN: Freelancer? Seeking freelancer? (July 2025)    · Posted by u/whoishiring
jamesmunns · 7 months ago
SEEKING WORK | Remote | Rust and Embedded Systems

Location: Berlin, DE

Remote: Yes

Willing to relocate: No

Technologies and tools: Rust, Embedded Systems (Cortex-M, RISC-V), Desktop/server apps/tools, async/await

Website: https://onevariable.com

Email: contact@onevariable.com

GitHub: https://github.com/jamesmunns

Hey, I'm James! I have my company (OneVariable), and have 7+ years of embedded Rust experience, and 10+ years of embedded experience. I've been helping teams start using Rust, or scale up their use of Rust, through advising, training, and development assistance, as well as "Senior as a service" to help teams that are ramping up but still need help with questions around embedded/rust. Happy to help customers in EU and NA time zones.

Let me know if you need any help getting big computers talking to smaller computers!

jamesmunns commented on Rust compiler performance   kobzol.github.io/rust/rus... · Posted by u/mellosouls
jtrueb · 8 months ago
A true champion

> when I started contributing to Rust back in 2021, my primary interest was compiler performance. So I started doing some optimization work. Then I noticed that the compiler benchmark suite could use some maintenance, so I started working on that. Then I noticed that we don’t compile the compiler itself with as many optimizations as we could, so I started working on adding support for LTO/PGO/BOLT, which further led to improving our CI infrastructure. Then I noticed that we wait quite a long time for our CI workflows, and started optimizing them. Then I started running the Rust Annual Survey, then our GSoC program, then improving our bots, then…

jamesmunns · 8 months ago
Kobzol is an absolutely wonderful person to work with. I also work in the Rust project, and any time I've interacted with him, he's been great.
jamesmunns commented on Quarkdown: A modern Markdown-based typesetting system   github.com/iamgio/quarkdo... · Posted by u/asicsp
andy12_ · 8 months ago
Is there any reason why you can't use Typst for any of the stuff you mentioned? I can't see why you couldn't (except for interactive forms, which is already being worked on [1]. The pdf-writer low-level backend seems to have already implemented support for form fields, so it seems like a matter of time until it is implemented in Typst).

[1] https://github.com/typst/typst/issues/1765

jamesmunns · 8 months ago
You definitely can, I designed a 206x85cm standing banner for my last trade show as one of the first "production" things I built in Typst:

https://typst.app/project/r1YNDcKpoF1sVXHf5n4VKB

Plus you can share the rendered and preview form of the project with a single link, which is pretty neat.

jamesmunns commented on Adipose tissue retains an epigenetic memory of obesity after weight loss   nature.com/articles/s4158... · Posted by u/paulpauper
squeedles · 10 months ago
As this article shows, there are incredibly complex feedback mechanisms around weight and metabolism, but thermodynamics are still fundamentally a thing.

After he died last year, I ran across this engineering and accounting approach to weight maintenance and loss written up by John Walker (one of the Autodesk founders). It worked very well for him and changed the way I thought about weight and eating. It is interesting reading because he is "one of us"

    https://www.fourmilab.ch/hackdiet/
Basically, he uses a first level approximation of the body as a control system with a feedback loop, and tries to pin down some techniques to bring the system to a known good state (target weight) and manage that loop for long term stability.

jamesmunns · 10 months ago
Thank you for sharing, I'd never seen this before. It's an incredibly good read (and relevant for me) so far.

u/jamesmunns

KarmaCake day1173September 26, 2016
About
james@onevariable.com
View Original