Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: derive proc_macro for automatically generating associated Tasm snippets for struct #45

Open
aszepieniec opened this issue Jun 15, 2023 · 0 comments

Comments

@aszepieniec
Copy link
Contributor

Suppose we have a struct

#[derive(BFieldCodec)]
pub struct StructuredWitness {
    pub field : Type,
    pub meadow: Kind,
}

that we use inside of a program that is written in rust and that needs to be converted to Tasm. The rust code can just dot its way into the right fields to access them. But the encoding of this object is passed to the VM's secret input as a list of BFieldElements. We then need to manually implement getters for every field in Tasm. It would be nice to automatically derive the getters in Tasm from a proc_macro derive

#[derive(BFieldCodec, TasmObject)]

which, for example, adds methods

  • tasm_get_field_field() -> String
  • tasm_get_field_meadow() -> String
    that output the indicated Tasm code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant