Fork me on GitHub
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?


We use it for an in memory SPARQL/datalog-like database… 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.


Have you looked at using tabling?


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:

👀 1

(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 :

Ngoc Khuat16:10:29

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


there is no alternative implementation. and this predated me


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

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.