Closed littledivy closed 10 months ago
Ok, scratch that idea. Found this amazing crate that offers a distributed const-context slice that can be used from a proc macro. It can be used to store all the stuff about symbols we need without having to do state management.
We need to improve the situation with
bindings.json
.It's a hacky approach for maintaing symbol metadata across non-deterministic proc macro runs and causes issues with rust-analyzer.
Unfortunately, there is no good solution to global state in proc macros. We need a more stateless way to metadata:
Each binding generates an initialization function.
[no_mangle]
extern "C" fn add(a: u32, b: u32) -> u32 { a + b }