Live data from Hacker News

DataScript: Immutable database and Datalog query engine in ClojureScript

github.com

1–10 of 30 posts

Re: DataScript: Immutable database and Datalog query engine in ClojureScript

#3
This is a project I've kept a closer eye on, as I'm thoroughly fascinated with Datomic, and the concept of using a similar system alongside functional approaches like React seems a good match.

Would love to hear comments from anyone who has given DataScript a test drive - I'm guessing from the alpha state that no one is using it in production but hey, who knows... some people like to live dangerously.

Re: DataScript: Immutable database and Datalog query engine in ClojureScript

#4
We're using it in production, but then, the author is on our team. We've been using Datomic in production since Jan 2013. It's as good as it says on the tin.

I love living dangerously, if danger means using full-stack Clojure and immutability -grin-

Re: DataScript: Immutable database and Datalog query engine in ClojureScript

#5
Immutable database? That doesn't make sense. If you can't mutate it, how do you write to it? How do you update records in it? If it's really immutable then you can't. Such a database is a compile-time constant.

These days everybody seems to throw around terms like immutable, isomorphic, pure etc. without actually knowing what they mean, or using them in contexts whey they don't make any sense.

Re: DataScript: Immutable database and Datalog query engine in ClojureScript

#6

Immutable database? That doesn't make sense. If you can't mutate it, how do you write to it? How do you update records in it? If it's really immutable then you can't. Such a database is a compile-time constant. These days everybody seems to throw around terms like immutable, isomorphic, pure etc. without actually knowing what they mean, or using them in contexts whey they don't make any sense.

The data is immutable, not the database itself, meaning that you create entries but not modify them. The same way you can not modify a constant after you create it. "Immutable data database" would sound a bit redundant.

Re: DataScript: Immutable database and Datalog query engine in ClojureScript

#7

Immutable database? That doesn't make sense. If you can't mutate it, how do you write to it? How do you update records in it? If it's really immutable then you can't. Such a database is a compile-time constant. These days everybody seems to throw around terms like immutable, isomorphic, pure etc. without actually knowing what they mean, or using them in contexts whey they don't make any sense.

The database is in fact immutable, it's just a persistent data-structure that allows for fancy queries.

You wrap that data-structure/database in a mutable reference type (an atom), like you do with any other data-structure in clojure if you need change.

Re: DataScript: Immutable database and Datalog query engine in ClojureScript

#8

Immutable database? That doesn't make sense. If you can't mutate it, how do you write to it? How do you update records in it? If it's really immutable then you can't. Such a database is a compile-time constant. These days everybody seems to throw around terms like immutable, isomorphic, pure etc. without actually knowing what they mean, or using them in contexts whey they don't make any sense.

> Immutable database? That doesn't make sense. If you can't mutate it, how do you write to it? How do you update records in it?

You don't write to the database, you perform an operation that takes a database and a write request and returns a new database. Same with updates. Essentially, the kind of things you think of as "mutating" operations have a signature of, in Haskell-ish notation:

  db -> operation -> db

Re: DataScript: Immutable database and Datalog query engine in ClojureScript

#9
I've been thinking a lot about using a datascript database in place of a large mutable deeply nested hash map, or other non-regular chunk of data, to keep track of state using the amazing clojurescript library re-frame[1].

There are some times when having a novel way to query could lead to simpler data.

[1] https://github.com/Day8/re-frame/

Re: DataScript: Immutable database and Datalog query engine in ClojureScript

#10
post #3

This is a project I've kept a closer eye on, as I'm thoroughly fascinated with Datomic, and the concept of using a similar system alongside functional approaches like React seems a good match. Would love to hear comments from anyone who has given DataScript a test drive - I'm guessing from the alpha state that no one is using it in production but hey, who knows... some people like to live dangerously.

Wrong guess. The project's repository has a list of things people built with DataScript. One of those is https://precursorapp.com It's highly usable, stable and fun app!
Post reply on HN