Currently Routine can be in two states: uncompiled or compiled, which have some differences:
uncompiled one has resources which are defined "locally", while compiled has "global" resources – i.e. symbol x represents the same variable in all the subroutines
uncompiled routine needs to have linked_params to propagate information about linkage between routines, while compiled routine doesn't need that.
This is confusing, as every time I look at test cases for evaluate, I wonder why there are no linked_params and how do we know that the symbols mean the same thing, only later to realize that these are already compiled.
Not sure what's a good way of handling that – two that come to mind are:
Add a field "compiled": true/false which would indicate what's the state of the routine?
Have separate classes for uncompiled and compiled routine?
Currently
Routine
can be in two states: uncompiled or compiled, which have some differences:x
represents the same variable in all the subroutineslinked_params
to propagate information about linkage between routines, while compiled routine doesn't need that.This is confusing, as every time I look at test cases for
evaluate
, I wonder why there are nolinked_params
and how do we know that the symbols mean the same thing, only later to realize that these are already compiled.Not sure what's a good way of handling that – two that come to mind are:
It's also worth noting that validation rules for compiled and uncompiled routines should be different (https://github.com/PsiQ/bartiq/issues/18).
This is related to https://github.com/PsiQ/bartiq/issues/21.
CC: @dexter2206