AlgebraicJulia / GATlab.jl

GATlab: a computer algebra system based on generalized algebraic theories (GATs)
https://algebraicjulia.github.io/GATlab.jl/
MIT License
24 stars 2 forks source link

Declaring models using @generated functions #21

Closed olynch closed 1 year ago

olynch commented 1 year ago

Currently, the @simplemodel macro uses staged evaluation; it generates some code, but the code it generates also uses eval. I think that we can avoid this use of eval by instead declaring @generated methods for the implementations of checkvalidity, typarg and ap. This potentially could speed up load time of Gatlab, because the bodies of the @generated methods wouldn't be evaluated until they are actually run.