This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-11
Channels
Hi, @alexmiller! I've found compile error using 1.12.0-alpha7.
Here is small repro snippet:
mike@mbp03 clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.12.0-alpha5"} hashp/hashp {:mvn/version "0.2.2"}}}'
Clojure 1.12.0-alpha5
user=> (require '[hashp.core])
nil
user=>
mike@mbp03 clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.12.0-alpha7"} hashp/hashp {:mvn/version "0.2.2"}}}'
Clojure 1.12.0-alpha7
user=> (require '[hashp.core])
Syntax error compiling var at (fipp/ednize/instant.clj:11:13).
Unable to resolve var: clojure.instant/thread-local-utc-timestamp-format in this context
user=>
mike@mbp03 java --version
openjdk 21 2023-09-19 LTS
OpenJDK Runtime Environment (build 21+37-LTS)
OpenJDK 64-Bit Server VM (build 21+37-LTS, mixed mode, sharing)
fipp, a dependency of hashp, used to use a hack to access a private var in clojure.instant
. https://github.com/brandonbloom/fipp/commit/ca9b107788d90804dc2ce986c33421cf987e63ed
that var has been removed, so the lib break entirely because of it doing something it shouldn't have done
but if you add fipp/fipp {:mvn/version "0.6.26"}
to the deps map above that should be fixed
Yes, this was necessary to get rid of the ThreadLocal
Please file an issue with hashp if needed
Has anyone tried making a persistent data structure resembling a db table with indexes, e.g. for expressing a coll of maps more efficiently in terms of memory (like tech.ml.dataset), but with indexes for efficient lookups by id, and, like in databases, the indexes are updated when the table changes? UPD: something that is not datascript or datomic, but more column-oriented for efficiency like tech.ml.dataset
it feels like this is something that might be very useful for managing an in-memory app state...
in the entity-attribute-value model, sorting by the attribute first gives you a column-oriented view
(...and sorting by V first gives you a reverse lookup by value, e.g. for uniqueness checks)
Do e.g. boolean value types in datomic use boolean arrays/vectors for memory efficiency?
Another option in the space that people have tried is rules engines. eg. https://github.com/oakes/odoyle-rules
I've been looking for something similar and still think there are opportunities for new options in the space. Would love to hear back if you find a solution you like!
I feel that at some level of domain complexity and data size, using uber-map for a client app state is not enough, and what is needed is a "database"
but sqlite is transactional and uses locking, which puts readers and writers at odds with each other
> at some level of domain complexity and data size, using uber-map for a client app state is not enough Yeah, a few years ago I ended up coming to the same conclusion and evaluating all of the available options that I could find. In the end, came up with my own thing (haven't published yet) because I wasn't quite satisfied with what was available. But it's for CLJS (hence me mentioning it at the start) and not column-based either.
would be cool to have something performant like sqlite/tmd, but persistent and lock-free like clojure data structures
Yea, I've been looking and haven't found an answer that feels right yet. I also think Relic is the most interesting. One of the features I want is to be able to use nested maps, which sqlite doesn't do very well.
Having a push API that can run effects when certain attributes change is also interesting.
FWIW, DuckDB has been making the rounds. It seems to support MVCC, there's also a library to integrate it with tech.ml.dataset. Haven't used it myself yet, no clue about anything else.
I evaluated datascript long time ago, but it was too slow for the kind of workloads I expected from it
@U050ECB92 but datomic local is free as in freedom?
If you're considering datalog dbs, then I've been having fun with https://github.com/juji-io/datalevin. The database itself isn't immutable, but it's similar to sqlite in that regard.
Same with https://xtdb.com/docs/, but I've found datalevin is little more straightforward as an embedded db compared to xtdb which seems more oriented towards db as a standalone process.
Clojure data.int-map does not have a cljs-version yet, but I wrote this: https://clojureverse.org/t/data-modelling-with-vectors/9826/1
Also re Datomic use of memory - I don't know for sure, since I don't have the source code, but there is a clojure.core/vector-of
which have primitive-typed vectors. I just assume this is used for the datomic indexes where applicable.
https://ask.clojure.org/index.php/13691/hash-hash-without-arguments-return-array-despite-docstring
(hash-set)
produces a PersistentHashSet
not an array set on both 1.11 and 1.12 for me...
(but, yeah, (hash-map)
produces an array map)