Fork me on GitHub
#datascript
<
2017-07-12
>
mrchance09:07:17

Hi, I am new to datascript. Can anybody tell me what the difference between transact and transact! is? They both seem to modify the passed atom Oo

Niki09:07:34

@mrchance transact! is the main one. transact was added to be compatible with Datomic API. It’ll additionally wrap transaction result into the future

mrchance09:07:03

Ah, ok, thanks

mrchance09:07:06

Also, thanks for datascript! It's so awesome

Niki09:07:16

glad you like it

mrchance09:07:14

I use it to store an AST for my language, and was worried about how difficult it might be to get the tree in there... It's

(defn parse-tree->db [tree]
  (doto (d/create-conn schema)
    (d/transact! [tree])))
after some very minor modifications to the parser 😂

Niki09:07:02

yeah, map unwrapping turned out to be quite useful

hmaurer10:07:33

@tonsky out of curiosity, how complex is it to implement a system like Datascript? (specifically executing Datalog queries)

hmaurer10:07:38

I haven’t looked at the source code yet

kurt-o-sys10:07:09

I'm planning to use ds server-side as db (implementing durability now - may be a more generic lib some day). Anyone any experiences with ds server-side, or benchmarks, or ideas for benchmarks, or ... ?

Niki11:07:37

@hmaurer well DS itself is pretty straightforward. Indexes required me to implement persistent B-Tree for clojure, but that’s almost straight from the books. Query engine is also pretty straightforward, except for the rules which are trickier. But if you want all that to run fast then it requires some work, yes

hmaurer11:07:30

thank you! I’ll check it out

mrchance14:07:56

Oh, nice, I am also interested in reading that