asami

zeitstein 2021-09-27T11:28:48.041700Z

Will investigate further. Many thanks for your kind help!

mpenet 2021-09-27T11:30:46.042Z

Is there any plan to support a storage backend such as FoundationDB in the future? Seems like it could be a good fit

mpenet 2021-09-27T11:36:31.042700Z

but I guess that might require some deep changes in the way IO is handled (since iirc now it's all "blocking")

mpenet 2021-09-27T11:38:02.043800Z

and potentially another storage impl based on something different than AVL (to leverage some out-of-the-box capabilities of Fdb), but that's another subject

quoll 2021-09-27T13:10:19.047600Z

Yes, it's all blocking now. I’m planning on doing a node-like approach where both sync and async APIs are available. The code should be similar, since I can use the Promesa library to maintain a lot of the code structure (even if it compiles down to something completely different).

quoll 2021-09-27T13:10:29.048Z

It will take me a while to get to it though

mpenet 2021-09-27T15:06:00.048200Z

that sounds good!

mpenet 2021-09-27T15:06:44.049Z

datahike does something like this, but mixin sync/async via macros can become hairy, stuff like error handling in particular doesn't translate always well

mpenet 2021-09-27T15:07:34.049500Z

but I guess there aren't many solutions to this if you want to keep decent sync performance

mpenet 2021-09-27T15:07:49.049900Z

function calls/closures etc do add overhead

quoll 2021-09-27T15:08:12.050500Z

Exactly. I don't want to slow down the synchronous code

quoll 2021-09-27T15:08:29.051200Z

Though I hate the idea of duplication 😢

mpenet 2021-09-27T15:08:50.051700Z

I think for pathom3 some profiling was done to compare promesa vs raw sync vs other solutions

mpenet 2021-09-27T15:09:13.052200Z

promesa came quite close to raw sync in most cases

mpenet 2021-09-27T15:12:11.053600Z

maybe just having a single promesa based path is not so crazy if these numbers add up

mpenet 2021-09-27T15:16:16.054100Z

and waiting for loom is not an option I guess since that wouldn't work for cljs

2021-09-27T19:43:44.056400Z

@quoll i can't figure out how to edit the wiki, but i noticed a small typo in the example for https://github.com/threatgrid/asami/wiki/3.-Loading-Data#json, (d/transact conn {:tx-data data})) has an extra trailing paren

👍 1
2021-09-27T19:44:19.056800Z

(using asami at work for JSON spelunking. working great so far! 🎊 )

😊 1
quoll 2021-09-27T19:50:41.057900Z

This has turned out to be a really useful application of Asami that I never expected

2021-09-27T20:17:59.058200Z

hm, is there an example floating around of querying within a single JSON object? i think i have the wrong mental model for dealing with e.g. object key values

2021-09-27T20:18:50.058400Z

such as getting all the names of the children given https://github.com/threatgrid/asami/wiki/3.-Loading-Data#json

2021-09-27T20:19:10.058600Z

and the "root" object is JSON object, not an array

2021-09-27T20:56:00.058800Z

Nevermind, found docs 🙂

quoll 2021-09-27T01:56:19.041100Z

It’s not built in. I actually do something like that when I’m emulating transactions on Datomic. • On start-transaction, start a with-db • Every call to transact also gets sent to a log. Because it’s using a with-db then the results of the transact operations are visible, even though they’re not being kept (but the log is keeping it for me) • On commit, replay the entire log as a single transact against the original connection.