logoalt Hacker News

RealtimeSanitizer for Rust

83 pointsby Archit3ch01/21/202516 commentsview on HN

Comments

jtwaleson01/23/2025

Ok so basically they are introducing annotations so that the compiler can reason about the code and warn the programmer for non-realtime usage.

When you think about it, it's a lot like a type system.

I haven't worked with realtime systems, but I have other constraints. E.g. I want the memory usage of a function to stay within x kilobytes, or I want an api call to return within a second, or I want to ensure there is no PII being sent to the logs.

I sincerely hope that in the future we'll have languages that cater to these kind of constraints. Think function coloring on steroids. This way the compiler can help figure out problems and we need way less tests.

show 3 replies
nevi-me01/22/2025

This looks like it could also be useful in embedded programming, specifically around detecting allocations in platforms that allow them.

Rygian01/23/2025

The remark on flagging mutex use was quite interesting. From afar, using mutexes in real-time code seems like asking for ~trouble~ formal validation.

oytis01/23/2025

Oh, I hoped it would be able to check timing constraints. In reality it's a linter marking known bad function calls.

saagarjha01/23/2025

Does this flag loops as well?

show 1 reply