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

feat: JS to Rust ZK Compiler #57

Merged
merged 12 commits into from
Feb 15, 2024
Merged

feat: JS to Rust ZK Compiler #57

merged 12 commits into from
Feb 15, 2024

Conversation

Bisht13
Copy link
Member

@Bisht13 Bisht13 commented Feb 5, 2024

Rewrite of the ZK regex compiler end to end in rust to remove all the outdated Typescript/Javascript and TS <> Rust interfacing code. This improves:

  • Support almost all regex syntax out of the box, not just our hardcoded ., +, etc in the DFA
  • Support international characters/unicode/utf-8 out of the box without adding any additional constraints
  • Make errors more legible and code more maintanable, as instead of tracing errors through multiple languages subcalling each other, it can all be in one integrated program
  • WASM bindings in rust still allow seamless calling from within TS/JS code

@Bisht13 Bisht13 changed the title feat: JS to Rust ZK Compiler [WIP] feat: JS to Rust ZK Compiler Feb 5, 2024
@Bisht13 Bisht13 changed the base branch from fix/handle-intl-chars to main February 9, 2024 12:51
@Bisht13 Bisht13 changed the title [WIP] feat: JS to Rust ZK Compiler feat: JS to Rust ZK Compiler Feb 14, 2024
Copy link

socket-security bot commented Feb 14, 2024

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: npm/@babel/preset-typescript@7.23.3, npm/ts-jest@29.1.2, npm/typescript@4.9.5, npm/typescript@5.3.3

View full report↗︎

@SoraSuegami
Copy link
Contributor

Thank you for your updates! I confirmed that all tests passed on my environment.
However, when I ran the tests multiple times, the circuits in circom/tests/circuits changed every time.
I fixed some non-deterministic processes in circom.rs, but the output circuits are still non-deterministic.
Could you fix regex.rs and circom.rs to ensure the output circuit is deterministic for the regex definition?

@Bisht13
Copy link
Member Author

Bisht13 commented Feb 15, 2024

Thank you for your updates! I confirmed that all tests passed on my environment. However, when I ran the tests multiple times, the circuits in circom/tests/circuits changed every time. I fixed some non-deterministic processes in circom.rs, but the output circuits are still non-deterministic. Could you fix regex.rs and circom.rs to ensure the output circuit is deterministic for the regex definition?

Could you check it now? I've fixed it, used BTreeSet and BTreeMap instead of HashSet and HashMap.

@SoraSuegami SoraSuegami merged commit 69f53db into main Feb 15, 2024
4 checks passed
@SoraSuegami
Copy link
Contributor

Thank you for your change!
I merged your PR!

@Bisht13 Bisht13 deleted the feat/js-to-rs-compiler branch February 15, 2024 15:56
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

Successfully merging this pull request may close these issues.

None yet

2 participants