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

frontend/ refactor: separate responsabilities to Builder, Compiler and API interfaces #271

Merged
merged 20 commits into from
Mar 1, 2022

Conversation

gbotrel
Copy link
Collaborator

@gbotrel gbotrel commented Feb 28, 2022

This PR builds on #270 . (see description for hint changes).

** API Breaking change **

Fixes #245 ; using options 4. --> frontend.Compile changed from :
frontend.Compile(curveID ecc.ID, backendID backend.ID, circuit Circuit, opts ...CompileOption) to frontend.Compile(curveID ecc.ID, newCompiler frontend.NewCompiler, circuit Circuit, opts ...CompileOption)

** Internal changes **

  1. Adds new frontend.Compiler interface, which exposes useful operations to gadget developers that do not fit in frontend.API . For example, to create a std/math/bits package, one needs to have access to MarkBoolean and IsBoolean apis from the constraint system compiler. Naming wise, end-users only see the term Compiler . (not Builders, etc).
  2. compiled.Variable is no more. It used to encapsulate a compiled.LinearExpression and a IsBoolean bool value. Replaced with compiled.LinearExpression, IsBoolean is managed through a map.
  3. frontend.WithCapacity was broken and compile options were not passed through constraint systems compilers
  4. IsConstant removed in favor of ConstantValue (reduces useless big.Int allocations)
  5. fix incorrect handling of nbBits == 1 in api.ToBinary

@gbotrel gbotrel added the consolidate strengthen an existing feature label Feb 28, 2022
@gbotrel gbotrel added this to the v0.7.0 milestone Feb 28, 2022
@gbotrel gbotrel merged commit 534a171 into develop Mar 1, 2022
@gbotrel gbotrel deleted the refactor-compiled branch March 1, 2022 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consolidate strengthen an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants