Re:Klint: Compile-Time Detection of Atomic Context Violation...
by ameliaquining on Saturday March 18, 2023 @11:55AM
(#35210113)
I think you want something like https://tmandry.gitlab.io/blog/posts/2021-12-21-context-capa.... The Rust maintainers have expressed interest in this possibility, but I don't think there's anything concrete yet.
[ Parent
| on HN ]
Re:Klint: Compile-Time Detection of Atomic Context Violation...
by JonChesterfield on Saturday March 18, 2023 @03:38PM
(#35212367)
That ^ is interesting in that it's (a syntax heavy version of) dynamic scoping with an implicit restriction that the call graph must be static. I.e. as described that does not work with function pointers (there is a todo reference to 'dyn', which looks like it means vtable dispatch, i.e. a special case of a function pointer call).
This suggests a general pattern given the above on memory allocation - some things are expressible on static call graphs. On dynamic call graphs, they need to either fail (could be at compile time) or induce a runtime cost.