Skip to content(if available)orjump to list(if available)

An effect system proposal for C2y

An effect system proposal for C2y

3 comments

·January 18, 2025

AlotOfReading

Not a big fan of this. The suggested effects have some ambiguities. For example, does sprintf imply the errno effect that's only required under POSIX? Does printf imply file or just system depending on implementation?

I'm also not sure what you really gain from this effort beyond mut annotations. It doesn't give you a way to detect or eliminate UB. It doesn't allow the compiler to optimize pure functions better like the reproducible directive does. A better effects system could do these things, but this is an unhappy middle ground between something simple enough to actually get standardized and something powerful enough to provide useful guarantees.

fithisux

It needs an implementation

pjmlp

For sure, however if you bothered to read it, MISRA verifiers and Deputy are given as examples from prior art.