powdr-labs / powdr

A modular stack for zkVMs, with a focus on productivity, security and performance.
Apache License 2.0
329 stars 65 forks source link

Allow patterns and type variables in asm declarations #1369

Open chriseth opened 3 weeks ago

chriseth commented 3 weeks ago

The asm pil statement only allows let x = .... We should extend this to patterns and also generic type parameters.

The main problem is that the main structure in asm processing maps names to values, something we cannot do when we have let (x, y) = f(). This means we have to change this to just be a list of unstructured declarations that implement a function to list the defined names.

We have to keep performance in mind, though, since reference resolving should not have to traverse the full declaration list.