noname icon indicating copy to clipboard operation
noname copied to clipboard

support const generic

Open katat opened this issue 7 months ago • 0 comments

This is to implement #142

Changes

AST:

  • Generic is to represent the generic parameter in the function signature. This involves modifications to the AST parser to support the generic parameter syntax.

  • GenericArray is to represent the Array type with symbolic size.

  • Support default repeated array declaration.

TAST:

  • Some minor updates to bypass the type-checking rules when comparing the types involve generic parameters.

MAST:

  • A new compiler pipeline phase in the middle between TAST and circuit writer.
  • Mainly responsible for inferring the generic parameters and type-checking the inferred types.

Circuit writer:

  • Updated to replace TAST dependency with MAST.

todo

  • [ ] add tests to cover more checking in mast.

  • cover the different types of inferring and expected errors.

  • cover the builtins with return type of generic array

  • [ ] refine the function calls to reflect the pipeline; related to https://github.com/zksecurity/noname/pull/147

  • [ ] clean up code

katat avatar Jul 16 '24 09:07 katat