from Hacker News

RealtimeSanitizer for Rust

by Archit3ch on 1/21/25, 2:45 PM with 16 comments

  • by jtwaleson on 1/23/25, 7:39 AM

    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.

  • by nevi-me on 1/22/25, 5:05 AM

    This looks like it could also be useful in embedded programming, specifically around detecting allocations in platforms that allow them.
  • by Rygian on 1/23/25, 9:03 AM

    The remark on flagging mutex use was quite interesting. From afar, using mutexes in real-time code seems like asking for ~trouble~ formal validation.
  • by oytis on 1/23/25, 12:01 PM

    Oh, I hoped it would be able to check timing constraints. In reality it's a linter marking known bad function calls.
  • by saagarjha on 1/23/25, 8:54 AM

    Does this flag loops as well?