Hacker News new | past | comments | ask | show | jobs | submit login
Clojurecademy is now open source (github.com/clojurecademy)
83 points by ertucetin on Oct 17, 2017 | hide | past | favorite | 20 comments



It's great to see clojure in the wild. I have to cringe a little at the use of a bunch of atoms like this:

  https://github.com/clojurecademy/clojurecademy/blob/master/src/cljs/clojurecademy/course.cljs#L37
Also, seeing a whole lot of calls to set-event-handler really rubs me the wrong way.

To the author, are you willing to let someone move this to more cljs (i.e. a big state atom with dispatches and subscriptions)?


Yes, why not :)


It's really cool to see how people are using the full clojure stack: clojure, clojurescript and datomic.


I know datomic is kind of like a logic based db right? Any example of the typical use case over a traditional relational db?


I'm more of a fan of Datomic's query language than SQL's. It's much easier to parameterize, you can manipulate it as a data structure rather than a raw string, and you can easily ask questions about what the database knew at a specific time. The "as-of" function lets you get the value of the database at a specific time, and the queries you are already writing anyways are against the current value of the database, so it's easy to compare the two.


Y do you care what the DB knew at a specific time?


It's useful in some scenarios, but I think the biggest benefit is debugging (something weird happened in prod? what was the database state?).

I think people try to stretch its usefulness to scenarios where it doesn't quite fit. It almost fits for historical reports, but from my experience, usually you're going to find an error in your data that you want to fix "in the past" so those old reports change, and all of a sudden datomic doesn't automagically work for your historical reports anymore.


To expand on the debugging bit, Datomic knows and can tell you the exact transaction responsible for every piece of data in the database. You can also see the complete state of the DB as of any transaction, but the complete history is more useful. It's like git blame for the database.


That's interesting (debugging).


It means that when you figure out how to calculate business metrics based off of information stored in Datomic, you get to compare how your business was doing versus how it's doing now for free. Or if you figure out a customer health score, it's now trivially easy to calculate how much it changed since last month.


It also means, if you're logging well, that you can replay the exact series of interactions, transactions included, that led to an end-user application failure.

Untangled (ClojureScript on React) + Clojure / Datomic on the back-end.


Now that is neat!


I used it to show the edit history of forum posts until I found out the hard way that you're not to store long strings in Datomic.


Let's say you are creating Git like system so you will need some data at specific time right?


Auditing, which might even be a legal requirement in some application domains.


I have audit tables in my relational database though...but its auditing is better?


All you have to do is call As-of in any expression to get a value relative to time, as the entire history of a named entity is stored efficiently with persistent data structures. It’s automatic, efficient, gives you the ability to query future values!


Their query language is based on Datalog (a non Turing complete subset of prolog.)

I can't think of a job where I would pick it over a SQL database. Maybe if you were already using Clojure, since there would be less impedance mismatch.


neat! but does anyone know of an equivalent OS project using js or ruby?


FreeCodeCamp? It's all an open source RoR app on Github.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: