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

Create a Noir --> TypeScript codegen tool #3348

Closed
8 tasks done
Tracked by #3079
kevaundray opened this issue Oct 29, 2023 · 3 comments
Closed
8 tasks done
Tracked by #3079

Create a Noir --> TypeScript codegen tool #3348

kevaundray opened this issue Oct 29, 2023 · 3 comments
Labels
enhancement New feature or request js Noir's JavaScript packages
Milestone

Comments

@kevaundray
Copy link
Collaborator

kevaundray commented Oct 29, 2023

Problem

With #3080 we have added the ability to execute Noir functions in TypeScript environments.

Problem is it hardly matches the speed with running native TS code given its ACVM overheads.

Happy Case

We should create a tool for codegening arbitrary Noir functions into TS functions, where developers can then execute such functions natively in TS environments.

For first step, we would have:

// exports.nr

#[export]
unconstrained fn foo(x : u8)-> u8 {
   x
}

This would then make the bytecode for foo be available in a json file to b executed/simulated in typescript.

This becomes a lot nicer once we migrate and finalize our typescript wrapper for the json file which will automaticallt generate the typescript types.

Alternatives Considered

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@kevaundray kevaundray added enhancement New feature or request P-MEDIUM labels Oct 29, 2023
@Savio-Sou Savio-Sou added the js Noir's JavaScript packages label Nov 2, 2023
@Savio-Sou Savio-Sou changed the title Add ability to export noir functions to be called by acvm_js in typescript Create a Noir --> TypeScript codegen tool Dec 4, 2023
@Savio-Sou Savio-Sou added E-HIGH and removed E-MEDIUM labels Dec 4, 2023
@Savio-Sou
Copy link
Collaborator

Updating to E-HIGH as we've already spent >1 week on the objective.

@Savio-Sou Savio-Sou added this to the 1.0 milestone Jan 2, 2024
@TomAFrench
Copy link
Member

Problem is it hardly matches the speed with running native TS code given its ACVM overheads.

Just to be clear, this will have the exact same overheads as before. We're not transpiling ACIR into Javascript, just adding a more usable wrapper around it.

@Savio-Sou
Copy link
Collaborator

Assuming the technical scope was completed, we still need to document the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request js Noir's JavaScript packages
Projects
Archived in project
Development

No branches or pull requests

3 participants