datalog

ikitommi 2021-08-10T08:20:50.051900Z

what are the options for (reagent-)reactive datascript on the frontend? posh (https://github.com/denistakeda/posh) seems unmaintained.

timo 2021-08-10T09:02:22.052100Z

Maybe https://github.com/homebaseio/homebase-react?

👀 1
ikitommi 2021-08-10T09:20:53.052500Z

hadn’t heard, will check it out, thanks!

lilactown 2021-08-10T16:07:29.052700Z

tbh there aren't a lot of amazing solutions.

lilactown 2021-08-10T16:08:55.052900Z

I think homebase is just a wrapper around datascript and reagent and exported for JS applications

lilactown 2021-08-10T16:12:02.053100Z

I say "amazing" as in, most of these use datascript and IME the performance of datascript is not good enough for most UI apps I've worked on. posh tries to address this by doing some complicated diffing internally to avoid triggering every query on change, but it doesn't end up being as robust as one would want and still can end up doing a lot of expensive calculations on every db transaction

lilactown 2021-08-10T16:12:21.053300Z

if you do find something that works for you I'd be very curious to learn more

ikitommi 2021-08-15T17:38:53.056800Z

homebase doesn't support pull queries, so it was out of the question. The project already uses (re-)posh, so will start by fixing posh, it cureently fails on tracking reverse relations.

ikitommi 2021-08-15T17:40:51.057Z

looking at the posh internals, it looks smart, the impl could be optimized a lot. If I understand it correctly, all the queries will register their own matchers, having 100 queries will cause 100x matching, which doesn't scale.

ikitommi 2021-08-15T17:42:42.057200Z

matchers could be grouped by their common parts, kinda like trie, would make it scale better.

ikitommi 2021-08-15T17:44:53.057400Z

... and with some smart incremental effect diffing, one wouldn't have to re-run the queries when a match is found, just patch the result with the new datoms.

ikitommi 2021-08-15T17:46:52.057600Z

but, will update here if I manage to cook up come improvements.

👍🏻 1
ikitommi 2021-08-16T11:27:45.057900Z

a quick fix: https://github.com/denistakeda/posh/pull/11