This is part of a larger refactoring that will essentially gut out SEMPRE in its original form, but we should do it before we adventure into more program synthesis.
Right now we use Value and Formula more or less interchangeably, because we don't have any "execution" step until much later in the client.
This causes some mild annoyances like having to run with "FloatingParser.executeAllDerivations", but also and more importantly renders the code in ApplyFn / AddOperatorFn / AddValueFn / AddCompositionFn completely unreadable, as the functions try to deal with Formulas so that subsequent CallFormulas don't explode, but they really want to manipulate thingtalk specific types, and those are Values.
My proposal is to simply remove everything that deals with Formulas, at all.
SemanticFns get updated to produce values directly (most do).
JoinFn and the lambdas die, replaced with a CallFn that calls the Java function directly (and maybe caches the method), or thingtalk specific SemanticFns.
The executors are eliminated
Type inference and the sempre type system (which is currently producing beautiful and useful anyAnyAnyTypes...) is eliminated
All the formula code goes poof
Downsides of this (besides diverging from sempre upstream) is that we lose some work that might be useful when implementing database questions. I say might because last time I had in fact implemented database questions using the sempre code it was a mess that was hard to integrate with the rest of thingtalk.
And honestly i feel like we care more about ifttt program synthesis that db questions...
This is part of a larger refactoring that will essentially gut out SEMPRE in its original form, but we should do it before we adventure into more program synthesis.
Right now we use Value and Formula more or less interchangeably, because we don't have any "execution" step until much later in the client. This causes some mild annoyances like having to run with "FloatingParser.executeAllDerivations", but also and more importantly renders the code in ApplyFn / AddOperatorFn / AddValueFn / AddCompositionFn completely unreadable, as the functions try to deal with Formulas so that subsequent CallFormulas don't explode, but they really want to manipulate thingtalk specific types, and those are Values.
My proposal is to simply remove everything that deals with Formulas, at all.
Downsides of this (besides diverging from sempre upstream) is that we lose some work that might be useful when implementing database questions. I say might because last time I had in fact implemented database questions using the sempre code it was a mess that was hard to integrate with the rest of thingtalk. And honestly i feel like we care more about ifttt program synthesis that db questions...