News for hackers. Stuff that matters.
Re:Datomic Is Now Free by greg7mdp on Thursday April 27, 2023 @03:43PM (#35733540)
Re:Datomic Is Now Free by gleenn on Thursday April 27, 2023 @07:16PM (#35735723)
Yes, this hit home so hard. All objects are bespoke mini languages that add little to no value and simultaneously make it hard to remember and hard to use. Just use maps!
Re:Datomic Is Now Free by oblio on Friday April 28, 2023 @02:08AM (#35738018)
An object is a schema, though.

A map is... Whatever you put in it.

Re:Datomic Is Now Free by simongray on Friday April 28, 2023 @03:30AM (#35738528)
This is the benefit. Languages like Clojure have excellent support for manipulating maps and I'd wager that something like 40-60% of Clojure code is similar-looking map manipulation stuff for this very reason.

If you need that validation, you just validate the map? You can use established methods like Malli or Clojure Spec for this. If you need to use a record with a fixed schema, just use a record instead of map. In Clojure, you can use most of the map functions for records too.

Re:Datomic Is Now Free by xpe on Friday April 28, 2023 @06:21PM (#35747848)
This comment is talking specifically in the context of Clojure.

In the Clojure culture (so to speak) maps may also have a schema, as used by various schema checking tools, which are richer than runtime type checks. (Not the same as database schema)

Nit: I would not say that a JVM object is a schema, because there’s more to it. Rich is well known for saying that the idea of an object complects two things: (1) a record-like (struct) data structure with the (2) code to manipulate it.

Sometimes it’s even more complected because in some languages classes can make assumptions about state across all objects and threading.

Re:Datomic Is Now Free by javajosh on Friday April 28, 2023 @09:37AM (#35741126)
Constraints always have value. Without constraints programmers are confronted with the naked complexity of mapping between the set of all possible states of N bits which is (2^N)!.
Re:Datomic Is Now Free by gsinclair on Friday April 28, 2023 @09:00PM (#35748951)
More constraints don’t necessarily have more value, though. Each constraint needs to be thought through, not just have its value assumed.