gixxi / lambdaroyal-memory

STM-based in-memory database storing persistent data structures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ClojureScript port?

roman01la opened this issue · comments

Is it possible to port this to ClojureScript? I'd really love to have an alternative to DataScript in the browser.

Hi there,

thanks for getting back on me. cljs does not support https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure STM due to the lack for a multithreaded environment. We could port this to cljs but we need to define what A(tomic) and (I)solated means in the context of javascript since data updates need to be evicted to a server that might be used by several clients concurrently. So each transaction commit needs to be flushed to a remote machine which implies a synchron i/o that (1) might fail for functional/non-function reasons and (2) takes time. If (1) and (2) are acceptable than we can port this to cljs. The aspect of transaction composition (clj's dosync) can be mimicked in cljs. So yes this could be done. I will decide within the next two weeks, whether I will start doing the migration.

thx
Christian