4 ms·
They all suck. C#'s Linq seems cool but I don't live in that ecosystem. Also Cypher fro graph DBs or better still Gremlin are nice and more elegant. But I'd ju
by nnq 7y ago
They all suck. C#'s Linq seems cool but I don't live in that ecosystem. Also Cypher fro graph DBs or better still Gremlin are nice and more elegant.
But I'd just want to write code like:
(employees * addresses)[employee.name, address.city.name]
| filter{address.city.name = "London"}
...that would match rel algebra notation nicely, and extend to complex cases more like:
( employees e *{e.id = a.employee_id} addresses a )
| filter{a.city.name = "London"}
| [e.name, a.city.name]
...you can replace operators with words of course. Or you could represent this as a JSON structure, even better imo. But the point would be to have a notation highlighting the idea of a "product", of restricting and specializing that product or specifying how it's made, and of indexing into its fields. The way I see it in my mind is like taking "a (maybe generalized) cartesian product" of different things, then filtering this, then zooming on each dot/point/object and filtering its fields etc. And obviously focusing on piping/chaining stuff.
Maybe the notation I suggest is not a good one, but I'd care more about making the concepts obvious and readable and composable.