Readit News logoReadit News
deosjr commented on What is Realtalk’s relationship to AI? (2024)   dynamicland.org/2024/FAQ/... · Posted by u/prathyvsh
deosjr · 8 months ago
Such an amazing project.

I've made a lot of progress recently working on my own homebrew version, running it in the browser in order to share it with people. Planning to take some time soon to take another stab at the real (physical) thing.

Progress so far: https://deosjr.github.io/dynamicland/

deosjr commented on Ask HN: What Are You Working On? (June 2025)    · Posted by u/david927
deosjr · 8 months ago
Exploring the implementation of Dynamicland (dynamicland.org) using Guile Scheme, Hoot (scheme->wasm) and miniKanren. Main write-up can be found here: https://deosjr.github.io/dynamicland/

I cycle between learning about scheme macro hygiene and implementing more and more realtalk/dynamicland demos and trying to grok the programming model. Doing this in the browser is a weird but fun constraint that makes things shareable.

My latest project is a wikipedia explorer: https://deosjr.github.io/dynamicland/wiki.html

deosjr commented on Web Embeddable Common Lisp   turtleware.eu/static/past... · Posted by u/todsacerdoti
deosjr · 9 months ago
I recently shared a project I did using Hoot, by Spritely institute. It's Guile Scheme compiling to WASM, and it works really well! See https://spritely.institute/hoot/

Latest on my project, in case you want to try it out: https://deosjr.github.io/dynamicland/whiskers.html

deosjr commented on Datalog in miniKanren   deosjr.github.io/dynamicl... · Posted by u/deosjr
thesz · 9 months ago
They use triples as triplets can represent any n-tuple facts.

E.g., if you have a fact id=(a,b,c,d), you can record triples (id, 1, a), (id, 2, b), (id, 3, c) and (id, 4, d) and reconstruct original fact.

Look at it as columnar storage in databases.

Then, if your query only needs a third value from a 4-tuple facts, you can get only those, ignoring first, second and fourth values. This is what columnar storage engines do.

In fact, I read that one of most efficient datalog engines use relational query execution under the hood.

Take a look here: https://github.com/philzook58/awesome-egraphs

The paper you'll most probably find interesting is "Better Together: Unifying Datalog and Equality Saturation," but there are many others interesting things there.

deosjr · 9 months ago
Cheers, this is super useful. I will have to do some reading. Being able to build up n-ary predicates using triples that way makes a lot of sense.
deosjr commented on Datalog in miniKanren   deosjr.github.io/dynamicl... · Posted by u/deosjr
davexunit · 9 months ago
Wow this might be the coolest use of Hoot I've seen! I need to run this for myself soon.
deosjr · 9 months ago
Thanks Dave, high praise! I was inspired after seeing you all take over the declarative & minimalist programming room at FOSDEM this year.

If you thought this was cool, wait until you see what I ended up using it for: https://deosjr.github.io/dynamicland/ I personally think this is much cooler :) But it needs some more explaining before I can broadly share, I think.

Now that I have you here, a question: am I correct in thinking that in Hoot, eval in the browser does not currently work with macros?

deosjr commented on Datalog in miniKanren   deosjr.github.io/dynamicl... · Posted by u/deosjr
kragen · 9 months ago
This sounds very interesting! I'll have to take a look.

I am always worried about posting comments like mine because often people get defensive when I try to engage, as I see it, on substance. Responses like yours make it all worthwhile!

deosjr · 9 months ago
I appreciate it; this kind of exchange is exactly why I read HackerNews. If you have any good sources on extending Datalog to N-ary relations, I'd love to know. Just had a look at the implementation I based mine on and it exclusively talks about triples: https://www.instantdb.com/essays/datalogjs

Coming from Prolog I'd like to get closer to the original if possible :)

deosjr commented on Datalog in miniKanren   deosjr.github.io/dynamicl... · Posted by u/deosjr
kragen · 9 months ago
Semantics are more important than syntax. Prolog's flexible syntax is a nice-to-have rather than essential when you're in Lisp. And Datalog is purely first-order, so the advanced Prolog you're talking about doesn't exist in it.

However, syntax does matter, and this is not acceptable

    (dl-find 
     (fresh-vars 1 
      (lambda (?id) 
       (dl-findo dl
        ((,?id reachable ,?id)))))))
as a way to ask

    reachable(Id, Id).
I think you could, however, write a bit more Scheme and be able to ask

    (?id reachable ?id)
which would be acceptable.

However, the ordering betrays a deeper semantic difference with orthodox Datalog, which is about distinct N-ary relations, like a relational database, not binary relations. This implementation seems to be specific to binary relations, so it's not really Datalog for reasons that go beyond mere syntax.

On the other hand, this (from the initial goal) would be perfectly fine:

    (dl-rule! dl (reachable ,?x ,?y) :- 
                     (edge ,?x ,?z) (reachable ,?z ,?y))
The orthodox Datalog syntax is:

    reachable(X, Y) :- edge(X, Z), reachable(Z, Y).

deosjr · 9 months ago
Thank you for the feedback! I agree with all of the above.

Should've probably been a bit more clear on the dl-find syntax; I find it just as unacceptable as you do. It is the result of laziness: my intended use of this minimal Datalog does not include any querying whatsoever but abuses fixpoint analysis for side-effects (see https://github.com/deosjr/deosjr.github.io/blob/master/dynam... which I intend to go over in a future post). I initially had it working like you described but butchered it for the above and haven't repaired it yet (see https://github.com/deosjr/whistle?tab=readme-ov-file#datalog). This version relied on some monstrous eval-hacking using a homebrew Lisp, which I've mostly cleaned up now in this version (https://github.com/deosjr/whistle/blob/main/datalog/datalog.... is a crime, for example).

The semantics are indeed limited to binary relations atm, which I agree is the main thing that disqualifies this as a proper Datalog. iirc the tutorial on Datalog that I based this implementation on only handled triples as well so I stopped there, but extending to N-ary relations is on my list to look into for sure.

deosjr commented on Datalog in miniKanren   deosjr.github.io/dynamicl... · Posted by u/deosjr
fithisux · 9 months ago
What scheme is this?
deosjr · 9 months ago
deosjr commented on Datalog in miniKanren   deosjr.github.io/dynamicl... · Posted by u/deosjr
deosjr · 9 months ago
Seems like interest in Datalog is high this week, so I thought I'd share a write-up of a minimal Datalog implementation I did a while ago.

Runs in the browser using Hoot (https://spritely.institute/hoot/) which compiles Guile Scheme to WebAssembly.

u/deosjr

KarmaCake day117July 5, 2023
About
https://github.com/deosjr
View Original