Closed jeromesimeon closed 4 years ago
Great! I quickly skimmed the changes and it looks already super useful. I'll use what you have for implementing if and for. In the future, we can grow support on the imp parser and the wasm backend in parallel.
Great! I quickly skimmed the changes and it looks already super useful. I'll use what you have for implementing if and for. In the future, we can grow support on the imp parser and the wasm backend in parallel.
That sounds great. It's been a pleasantly easy exercise but also reveals some interesting things about Imp and how to make parsing easier, and how to improve the internal AST for Imp which I'm mulling over. I'll try and do a bit more between now and tomorrow, notably get some basic structure for operators and a few more examples.
@pkel Since you like the general direction, I'll likely merge whatever I have at the end of today so you can play with it tomorrow.
Fun fact: along with https://homepages.inf.ed.ac.uk/libkin/papers/icdt01.pdf the examples in this PR prove that Imp + arithmetics is strictly more expressive than the relational algebra. (i.e., you can express aggregation without adding aggregate functions to the language).
Signed-off-by: Jerome Simeon jeromesimeon@me.com
Hi @pkel
A sneak peek into a possible direction for imp parsing with a couple of examples in
./tests/imp_ejson
Runtime function would be called using
Runtime.name
wherename
is the name of the runtime function. Haven't quite made up my mind about operators yet. I shied away from trying to make an entirely genericimp
parser because I couldn't quite figure out what to do with constants and operators...You can test
imp_ejson
eval andjs
eval by doing:Suggestions for syntax and what might be useful to support most welcome.
Flags
Runtime.recDot
)