(no title)
darioush | 11 months ago
If you create a query language, then the state can be verified to match expectations at any point.
I'm not sure why we don't program like this.
darioush | 11 months ago
If you create a query language, then the state can be verified to match expectations at any point.
I'm not sure why we don't program like this.
DowsingSpoon|11 months ago
I don’t really know what you’re talking about, and have a hard time imagining how ideas from relational algebra can be applied to all APIs.
For example, many database-like things already use relational algebra and an actual query language, for sure. But how does this apply to, say, a GUI toolkit or an audio device driver?
darioush|11 months ago
it may be that a bug only shows when hundreds of transitions are performed (like an overflow or bug due to large data), but that's more stress testing. many bugs have repros involving a few state transitions.
relational algebra is a useful tool in my opinion because much of programming involves adding/removing things from sets or testing for their membership in a set. also relations are powerful as they can express recursive ideas like which widgets are contained within others (from the GUI example).
relations also allow defining invariants at a high level which must be true at any state. (eg, there should be no state like: audio_buffer_is_empty and audio_playing)
additionally we have languages such as SQL or for example https://alloytools.org/applications.html that can help programmers specify this in a familiar way.
brad0|11 months ago