86 points · by ivank · 9y ago · 31 comments
"DataScript asks the question: "What if creating a database would be as cheap as creating a Hashmap?"
Mentat is not interested in that. Instead, it's strongly interested in persistence and performance, with very little interest in immutable databases/databases as values or throwaway use."
and:
"Datomic has a beautiful conceptual model. [...] Many of these design decisions are inapplicable to deployed desktop software; indeed, the use of multiple JVM processes makes Datomic's use in a small desktop app, or a mobile device, prohibitive.
Mentat is designed for embedding, initially in an Electron app (Tofino). It is less concerned with exposing consistent database states outside transaction boundaries, because that's less important here, and dropping some of these requirements allows us to leverage SQLite itself."
How would I use it? How does a query look like?
https://medium.com/project-tofino/introducing-datomish-a-fle...
Sure - I'm highlighting the differences from DataScript/Datomic. My take is the 'inspiration' from each (especially DataScript) is quite loose.
Datomic's model (both architectural and conceptual) draws from Clojure's concepts of persistence. That model isn't free, so Mentat deviates from it where it makes sense to do so: at present we don't implement querying of history or past states, for example, and when we do it won't be free.
We'll get closer to full Datomic-style datom store capabilities over time, but we'll make different performance tradeoffs.
>
> cargo run serve
So, not embedding.
https://github.com/mozilla/mentat/blob/rust/tests/external_t... looks like some sample usage.
It looks like it works both ways.
We are several months from that, though!
Unfortunately, this means that the path for using this in non-Node Javascript environments (i.e. browsers) is unknown.
The original implementation was in ClojureScript. This reimplementation is in Rust, and is intended to work anywhere you can run Rust code: inside Node, inside Firefox, and in standalone applications.
We expect a WebExtensions API to wrap this inside Firefoxes at some point, but right now we're focused on the core (re)implementation.
RDFox: "A highly scalable in-memory RDF triple store that supports shared memory parallel datalog reasoning. It is a cross-platform software written in C++ that comes with a Java wrapper allowing for an easy integration with any Java-based solution."
https://www.cs.ox.ac.uk/isg/tools/RDFox/
Dedalus: Datalog in Time and Space, by Peter Alvaro out of UC Berkeley (note the StrageLoop talk):
https://disorderlylabs.github.io/
Datalog -> Gremlin: It shouldn't be too hard to implement Datalog on top of the Gremlin Graph Virtual Machine so that Datalog compiles down to Gremlin bytecode -- SPARQL and SQL implementations already exist -- and running Datalog on the GVM would allow you to run Datalog on any datastore Apache Tinkerpop supports (all the graph DBs, HBase, Cassandra...):
Graph Computing with Apache TinkerPop, by Marko Rodriguez (the creator of Gremlin) https://www.youtube.com/watch?v=tLR-I53Gl9g
A Gremlin Implementation of the Gremlin Traversal Machine http://www.datastax.com/dev/blog/a-gremlin-implementation-of...
Yet implemented in Rust. Why? If you want adoption, the best way to design something "for embedding" is to write it in C.
Widespread adoption a la SQLite is not one of our goals.
Rust meets our goals just fine… and it also produces demonstrably more correct software than C, which is important to us. (Not to mention leveraging the borrow checker and data race avoidance to provide safe near-automatic parallelization, which is a neat trick that's not in C's quiver.)
I would rather build Mentat in Swift or JavaScript than in C.
> that _ends up calling into C_ anyway.
What specifically do you mean here?