g’day
i have looked at december edition of v2. You have done good job on xtql, documentation and all, much further into proper language.
i could not try for real via http with transit+json from outside (python) - both /query and /tx yielded some server errors (and that after quite some reverse engineering of what exactly to send over).
But i did study the xtql… and tried to wrap/represent it in grammar-like structures in python. i like the composability achieved although there are some quirks to tune.
Biggest problem for me is that there is still quite some Clojure-implementation leaking into the language. Mostly the “keyword” notion, usage of mapping and sequences , positional vs (lack of) named parameters.
For example, the Unnest and With, both (should) have grammar of simple kind:
operation ::= ( NameSpec+ ) ;
Namespec ::= Name | Name_Expr_Pair ;
Name_Expr_Pair ::= { Name : Expr }
Whether those Names are treated semantically in the particular usage as variable-names, column-names, or other-names, is irrelevant on grammar level. And there should be no difference syntactically - especially if the two different meanings are never used within same operation, so there is no need to distinguish them on this level at all.
so there should be no difference in {:somename 123 } vs {somename 123 } or even {‘somename’ 123 }, or even even [‘somename’ 123] - all are a pair of key_name+value_expr . It is the overarching operation (unify- or pipeline-) that should impose treating those names as needed for itself. (Also another less important: is a lone Name essentially same i.e shortcut to a pair like {Name Name} ?. But that’s hair-splitting).
on Mapping and sequences… and parameters in general. The fact that Clojure (and its interminent data protocols, EDN and transit-json) treats comma as whitespace, makes reading maps somewhat awkward. All items look same, cannot easily separate key-value pairs - one has to count items, odd ones being keys, even ones being values. When keys are :keywords that might be fine, unless the values are also :keywords , Or When keys are symbols, and values are symbols - all looks same.
Similarly but in other way, in the case/cond function, the value:result pairs are a mapping but are not represented as such. Could be made separate somehow. And the default-expr should be named somehow. Now there is one long list/sequence of positional arguments, and which is what, is not understandable. (case a b c d e f) and (cond a b c d e) are both valid things, go figure which is what.
One of the things that SQL does achieve, is being verbose enough to name things, so each item/variable can be easily deduced what it is from the operator-names around it. It may be much more verbose than needed, and maybe with weird “perspectives” here and there, but still… is not relying much on positions, colons, bracket-kinds, and similar stuff to mean (guessed) unnamed-but-important things.
Would be good if there are more named semantics in xtql , and less “assumed-from-punctuation/position” guessing.
e.g. use “pipeline” as word instead of “->”. .
my 2 cents
ciao
svil