Fork me on GitHub
#datascript
<
2019-05-14
>
Daniel Hines00:05:48

For reference, this is what we’re talking about, right? https://github.com/comnik/declarative-dataflow

Daniel Hines00:05:52

Upon closer inspection, it seems like we need both the server and a frontend implementation (which might be clj-3df compiled to browser-compatible cljs)

ncg07:05:42

I have some sketches over at https://github.com/comnik/functional-differential-programming, regarding WASM 3DF + React. But we are currently focusing on the foundations, before exploring more oft that.

👍 4
ncg07:05:32

Apart from integrating the inherently change-based 3DF with the more snapshot-based React, the WASM bundles are quite large still.

ncg07:05:12

The backend is most important, the frontend adds the Datalog syntax. Frontend should already be cljs compatible.

ncg07:05:09

We also support pull queries in the backend now, that still has to be supported in the client. In any case, reactive frontends with just DataScript worked and still works pretty well for us!

urzds09:05:42

Is it correct that Datomic keeps information about attributes as part of the database, using :db/ident, while DataScript uses a separate schema for that? I am looking at https://docs.datomic.com/on-prem/getting-started/transact-schema.html vs http://udayv.com/clojurescript/clojure/2016/05/06/datascript101-chapter2-uniqueness-and-indexing/

danielstockton09:05:09

Yes @urzds, datascript schema is separate and not queryable afaik

✔️ 4
danielstockton09:05:45

In datascript, you only add things to the schema when you need special functionality like cardinality many. Otherwise, you don't need to declare attributes in the schema, you can just start using them.

urzds09:05:09

Ah, in Datomic I need to declare everything?

👍 4
urzds11:05:10

Is it correct that I can specify refs as [:unique-key "value"] or {:multiple "val1" :keys "val2"}, and in the former case (`[]`) the referenced element has to exist already, while in the 2nd case (`{}`) it will be automatically created if missing?

urzds11:05:28

(It appears like that in DataScript, but I couldn't find any docs / specifications that seem to enforce this.)

lilactown15:05:26

(ds/q '[:find ?tx ?id ?v ?ts
               :where
               [?e :entry/value ?v ?tx]
               [?e :entry/id ?id ?tx]
               [?e :entry/ts ?ts ?tx]]
             app-db)
☝️ this query doesn't work under advanced optimizations. any ideas why?

lilactown16:05:59

#datascript/DB {:schema nil, :datoms [[1 :entry/id 15 536870914] [1 :entry/ts 1557849697260 536870914] [1 :entry/value {:value 1, :meta nil} 536870914]]}
is the DB for instance

lilactown16:05:14

and that query returns #{[nil nil nil nil]}