-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Labels
Description
we should standardize how we write builtins by using some trait that looks like this or something:
trait Builtin {
const sig: &'static str;
const no_typecheck: bool;
fn typecheck(
generics: &GenericParameters,
vars: &[VarInfo<F, LinearCombination<F>>],
span: Span,
) -> Result<()>;
fn builtin(
compiler: &mut CircuitWriter<R1CS<F>>,
_generics: &GenericParameters,
vars: &[VarInfo<F, LinearCombination<F>>],
span: Span,
) -> Result<Option<Var<F, LinearCombination<F>>>>;
}and the typecheck() function could contain all of the actual checks that need to be done.
Reactions are currently unavailable