@thautwarm is being kind in using “we” a lot in her description of the solution, so I think some context is helpful.
I’ve struggled with the right way to get around eval
/invokelatest
since very early in my work on Soss
(first commit December 2017). At JuliaCon 2019 I learned the several others were facing this same problem, as discussed here.
@mohamed82008 had previously suggested to me to encode my entire model in the type in order to use generated functions, but I couldn’t quite figure out how to get it to work. And @jpfairbanks had a similar suggestion for encoding algebraic manipulations as types. [We had been joking around and I thought he was trolling me, but now it doesn’t seem so infeasible].
Anyway, even if generated functions had supported closures from the beginning, it wouldn’t have been clear to me how to take advantage of this. So the detailed write-up above is really helpful. Really, my part in GG.jl so far has been to provide an interesting problem to work on