Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Addressing crate local state for procedural macros problem #43

@mikevoronov

Description

@mikevoronov

Hi! Thank you for this cool work!

I think that this approach could also address this issue. More precisely, I mean persistent data storage for all macros. This could be obtained by Wasm multimodules approach and sharing the same memory for one modules. Moreover, SQLite or Redis could be used to save state. All of them compiled in such a way to work like in-memory db without any imports. With our proc macro they could be used in the following way:

#[invocation_handler(side_modules = redis)]
fn run(arg: String) -> Vec<u8> {
    redis::call("SET A 1")
}

#[invocation_handler(side_modules = sqlite)]
fn run(arg: String) -> Vec<u8> {
    sqlite::call("SELECT * FROM Table")
}

And I can adapt them to any convention.

What do you think about that? I haven't look at the internals of watt, so can't estimate how many should be add to support this idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions