Fork me on GitHub
#core-logic
<
2021-10-27
>
Ngoc Khuat16:10:09

Hi ? anybody here ? ^^ I’ve tried the core.logic a week ago and curious are there any projects that use it in production?

rickmoynihan09:11:12

We use it for an in memory SPARQL/datalog-like database… https://github.com/Swirrl/matcha I wrote it 3 years ago as a quick hack to do an in memory datalog like database. I couldn’t use datascript as we needed something schemaless… these days I’d probably look at using asami instead.

Ngoc Khuat12:11:58

what do think about it performance tho? Or what would be the best case to use it? I tried it to do a two-sum problems and once the input arrays have around ~100 elems then it goes insanely slow.

rickmoynihan12:11:00

Have you looked at using tabling?

rickmoynihan12:11:02

It’s supported in core.logic It’s a fancy version of memoization, that can improve the performance of some core.logic algorithms a lot; and also help ensure some algorithms terminate. It’s probably best documented in Will Byrds thesis: https://raw.githubusercontent.com/webyrd/dissertation-single-spaced/master/thesis.pdf

👀 1
rickmoynihan12:11:24

(It has a section on it)

Ngoc Khuat16:10:16

I’m also trying to make a series to benchmark its speed with the lazy-seq and others implementation: I made a small note here : https://ngockhuat.me/logic

Ngoc Khuat16:10:29

ohhh, did you happen to benchmark it if we do it in the traditional way?

dpsutton16:10:13

there is no alternative implementation. and this predated me

dpsutton16:10:20

context: we construct joins between all of the filters on a dashboard to create a single query that links all of the valid values for the dropdowns. From the first one to each other one. Since these can include duplicates, we pass all of these joins into this dedupe function so that we have only one join that satisfies all tables we need to hit

👍 1
dpsutton16:10:27

the test namespace has some examples

Ngoc Khuat01:10:14

This is such a cool graph problem. It must feel good to write that piece of code.