TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ideas for DataScript 2

79 pointsby alex_hirneralmost 3 years ago

9 comments

sekaoalmost 3 years ago
Reactive updates is the big one, in my opinion. DataScript is a triumph and arguably is the reason why so many note-taking tools (Roam, Athens, Logseq, etc) are written in Clojure. But there are so many cases where it would be nice to react when some set of entities is changed.<p>I think what we need is to figure out how to combine DataScript with a rules engine. I wrote a rules engine and made a writeup that compares the two together: &quot;Using O&#x27;Doyle Rules as a poor man&#x27;s DataScript&quot; <a href="https:&#x2F;&#x2F;github.com&#x2F;oakes&#x2F;odoyle-rules&#x2F;blob&#x2F;master&#x2F;bench-src&#x2F;todos&#x2F;README.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;oakes&#x2F;odoyle-rules&#x2F;blob&#x2F;master&#x2F;bench-src&#x2F;...</a><p>Subscribing to individual entities is nice but with a rules engine you have so much more fine-grained control over your reactions. And with the RETE algorithm this can be done efficiently. Most libraries in this space just ignore it and make their own ad-hoc solution -- an informally-specified, bug-ridden, slow implementation of half of a rules engine.
评论 #32459580 未加载
评论 #32458546 未加载
jitlalmost 3 years ago
Notion alumnus Chet Corcos (<a href="https:&#x2F;&#x2F;twitter.com&#x2F;ccorcos" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;ccorcos</a>) is working on a local-first database that matches a lot of these ideas:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ccorcos&#x2F;tuple-database" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ccorcos&#x2F;tuple-database</a>
jwralmost 3 years ago
The big question is: if you don&#x27;t need queries (which I agree you don&#x27;t), then why bother with DataScript at all? Why not just store your data in native Clojure&#x2F;ClojureScript data structures, using the right structure for each thing and use a small number of data access functions, possibly maintaining an index or two?<p>This is what I did: migrated an app (arguably a fairly complex one) from DataScript to native Clojure data structures. Not because I didn&#x27;t like DataScript: I actually liked the idea a lot, but because I couldn&#x27;t justify the cost in performance and complexity (in my case, DataScript not handling nil values was a problem as well).
lilactownalmost 3 years ago
The &quot;Optimized B-Trees&quot; section I _think_ is suggesting to get rid of datoms, which I 100% agree with. I do not think they add anything at all; IME you can have a collection of all attributes indexed by entity ID and then have additional indexes on top of that collection.<p>My stupid question is: why even bother with B-Trees? I believe asami[0] stores everything in memory using Clojure maps &amp; sets.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;quoll&#x2F;asami" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;quoll&#x2F;asami</a>
评论 #32462908 未加载
areichertalmost 3 years ago
I know the founders of InstantDB [1] are using some of these ideas for inspiration :)<p>[1]: <a href="https:&#x2F;&#x2F;www.instantdb.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.instantdb.com&#x2F;</a>
评论 #32460639 未加载
openfuturealmost 3 years ago
Very good pointers, match my thinking on the topics I had considered.<p>One thing though is that I&#x27;m not a fan of uuids, I think content addressing is sufficient if you build everything around that. Actually I feel all IDs can be content address and type&#x2F;name&#x2F;context. Ofc I&#x27;m approaching this slightly differently, I don&#x27;t care about web browsers but I care about p2p and replication..
评论 #32460572 未加载
CGamesPlayalmost 3 years ago
How come there is no SQLite of Datalog? You can find plenty of implementations of embedded datalog database in a specific language, where the query API is tied to the language. I want to write text datalog queries and access my database from multiple languages. Why doesn’t this exist?
评论 #32459662 未加载
评论 #32459483 未加载
评论 #32461867 未加载
评论 #32466841 未加载
stevesimmonsalmost 3 years ago
Recognising this is a mainly Clojure audience, are there any Python equivalents of DataScript?
typingmonkeyalmost 3 years ago
Sounds like the feature set of RxDB [1].<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;pubkey&#x2F;rxdb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pubkey&#x2F;rxdb</a>
评论 #32458380 未加载