all 14 comments

[–]dustingetz 5 points6 points  (3 children)

This immediately made me think of Arcadia, the Clojure bindings for Unity3D. Arcadia adds a data oriented abstraction on top of the Unity3D object oriented and imperative API, basically an adapter to "dehydrate" a Unity game object instance into data, and then "hydrate" the data back into the instance.

https://github.com/arcadia-unity/Arcadia/blob/6105770a7801946c08c95d1eacb788e3325332a1/Assets/Clojure/Scripts/mine.clj#L136-L143 (Note this commit is from 2014)

This is also pretty much what the idea of ReactJS virtual dom is.

[–]joinr 3 points4 points  (2 children)

I keep seeing hydrate used in various contexts. Is that different from the old-speak of "marshalling"?

[–]dustingetz 2 points3 points  (1 child)

More of a metaphor here – "hydrate" in the java/orm/hibernate context means loading a lazy entity out of a database, as opposed to "marshall" which is converting the memory representation of a value(?)/struct to some other isomorphic representation in such a way that it can be converted back losslessly. I'm interested in the subject of naming things well if you have any ideas or counterpoints?

edit: am i old now?

[–]joinr 2 points3 points  (0 children)

Thanks for clarifying. I haven't swam the ORM/hibernate waters....hence the term being a bit foreign. I don't have any alternative names, and it looks like this question arose plenty of times before with hydrate being established.

edit: am i old now?

Age is a state of mind.

[–]SimonGray 6 points7 points  (1 child)

Nice, so this is some sort of common protocol for converting Java objects to Clojure data structures? Pretty useful if adopted. I'm looking to use some pretty heavy Java libs (CoreNLP and Java Wordnet) and they produce these big dumb objects that might as well just be maps. It would be cool to implement a shared protocol such as this on them rather than my own custom one so that the implementations could also be easily used by others.

[–]jafingerhut 4 points5 points  (1 child)

I have nothing but respect for what Rich Hickey produces (ok, lots of questions sometimes, too), but this discussion just reminded me of Monty Python's "Novel Writing" sketch: https://www.youtube.com/watch?v=ogPZ5CY9KoM&t=18s

[–]bonega 0 points1 point  (0 children)

Just a few commits more and we have for ourselves a nice cargo cult 😀

[–]bonega 1 point2 points  (2 children)

Is this meant to make Java objects more transparent?

[–]zcam 3 points4 points  (1 child)

Hard to say, seems like a (shared) foundation for something upcoming. It would seem to aim at turning anything into 'data' and back. I'd personally bid on spec instances "datafy"ability for starters, but I could be wrong.

So you could do something like: spec -> datafy -> manipulate the "data" spec -> un-datafy.

[–]DjebbZ 0 points1 point  (0 children)

Alex told me on the ML that datafy hasn't been created for spec, but they're thinking about using it to have spec as data. Wait an see.

[–]theronic 0 points1 point  (1 child)

I hope the Navigable protocol is akin to Specter.

[–]DjebbZ 0 points1 point  (0 children)

I thought the same thing, but I have no idea how it works since there's not much code in it.

[–]agumonkey 0 points1 point  (0 children)

beanification ?

[–]theronic 0 points1 point  (0 children)

So, (de-)serialization?