logoalt Hacker News

jtwaleson01/23/20253 repliesview on HN

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.


Replies

Sharlin01/23/2025

Resource (including time) use is a type of (side) effect, and when effects are modeled at type system level we talk about effect systems[0]. There's definitely quite a bit of interest in effects among the programming language design/theory crowd.

[0]: https://en.wikipedia.org/wiki/Effect_system

dymk01/23/2025

It's not like a static type system, and the compiler isn't doing any new reasoning about the code with the sanitizer enabled. It's all runtime checks.

show 1 reply
actionfromafar01/23/2025

It feels like a lot of such constraints should be possible already in some languages...

show 1 reply