chlorine-clover

About Chlorine for Atom and Clover for VS Code: https://atom.io/packages/chlorine and https://marketplace.visualstudio.com/items?itemName=mauricioszabo.clover
jlmr 2020-03-23T08:10:51.187800Z

Hi, I’m experiencing something strange with chlorine. I’m trying out https://github.com/replikativ/datahike/ and chlorine “hangs” when I try to eval/inspect (using @seancorfield’s sean:inspect-block command) a (d/transact tx-data) form. The same form returns almost immedeatly if I paste it directly into the repl in my terminal. How can I debug this issue?

mauricio.szabo 2020-03-23T12:37:05.188300Z

Hello. With chlorine:evaluate-block, does it hangs too?

jlmr 2020-03-23T13:38:03.188700Z

@mauricio.szabo Yes it also hangs in that case

jlmr 2020-03-23T13:38:55.189100Z

In the terminal repl the same form returns the following: #datahike.db.TxReport{:db-before #datahike/DB {:schema {:db/ident #:db{:unique :db.unique/identity}, :page/title #:db{:ident :page/title, :valueType :db.type/string, :cardinality :db.cardinality/one, :unique :db.unique/identity}, 1 :page/title}}, :db-after #datahike/DB {:schema {:db/ident #:db{:unique :db.unique/identity}, :page/title #:db{:ident :page/title, :valueType :db.type/string, :cardinality :db.cardinality/one, :unique :db.unique/identity}, 1 :page/title}}, :tx-data [#datahike/Datom [536870915 :db/txInstant #inst "2020-03-23T13:38:30.527-00:00" 536870915 true]], :tempids #:db{:current-tx 536870915}, :tx-meta nil}

mauricio.szabo 2020-03-23T13:44:20.189800Z

Is it a commercial/private project, or is a code you can share so I can debug it here?

jlmr 2020-03-23T13:45:56.190100Z

It’s a public project I’m using: https://github.com/replikativ/datahike/blob/master/src/datahike/api.cljc#L72

jlmr 2020-03-23T13:46:53.191300Z

The code I’m using is:

(ns dc.context
  (:require [datahike.api :as d]))

(def uri "datahike:<mem://dc>")

(def schema [{:db/ident :page/title
              :db/valueType :db.type/string
              :db/cardinality :db.cardinality/one
              :db/unique :db.unique/identity}])

(d/create-database uri :initial-tx schema)

(def conn (d/connect uri))

(d/transact conn [{:page/title "Welcome"}
                  {:page/title "Hello World"}])

mauricio.szabo 2020-03-23T13:53:21.192100Z

Yes, I can reproduce here. Thanks, I'll see what's happening

jlmr 2020-03-23T13:55:44.192400Z

Great, as always: thanks for the help!

jlmr 2020-03-23T13:55:52.192600Z

Let me know if I can do something to help

seancorfield 2020-03-23T15:15:45.192900Z

@jlmr Are you using Cognitect's REBL?

seancorfield 2020-03-23T15:16:33.193500Z

If not, there's no point in using the inspect commands.

mauricio.szabo 2020-03-23T15:17:24.194200Z

@seancorfield I think its a bug on Chlorine, because "evaluate-*" commands also freeze

seancorfield 2020-03-23T15:19:38.194600Z

Oh, I missed that part. Fair enough.

jlmr 2020-03-23T15:25:52.194700Z

I am 🙂

mauricio.szabo 2020-03-23T16:51:08.196Z

Oh, that's strange... it's somehow parsing your result as a map with duplicated key: 1... and the parser I'm using clojure.reader/read-string 😞

jlmr 2020-03-23T17:37:54.197100Z

Oh that doesn’t sound like it’s an easy fix

vlaaad 2020-03-23T17:38:58.197600Z

Hmm, could be something with datoms acting both as vectors and maps

mauricio.szabo 2020-03-23T17:41:59.199500Z

I think the problem is with UNREPL - it is the result REALLY strangely...

jlmr 2020-03-23T17:43:15.200Z

Has it something to do with the reader tags?

mauricio.szabo 2020-03-23T17:53:43.200700Z

I don't think so. I just reported to UNREPL: https://github.com/Unrepl/unrepl/issues/52, but I'll also try to debug from here.