Fork me on GitHub
#off-topic
<
2019-05-08
>
polymeris20:05:14

I am looking for a serialization format that is compact and bijective, i.e. I can compare encoded values to know if the values are equal. Any suggestions?

polymeris20:05:33

I found https://en.wikipedia.org/wiki/Bencode but it's a bit primitive (no UTF support)

dominicm20:05:00

I think bencode is out of band utf @polymeris nrepl certainly sends utf over bencode

polymeris01:05:39

Yep, seems to work. I wish it mapped better to cljs types, but I think I can work with it

john22:05:38

Do these data classes smell anything like Clojure records to any of y'all? https://www.infoq.com/news/2018/02/data-classes-for-java

lilactown22:05:22

yep, lots of languages have record types

lilactown22:05:36

everyone's learned from Java's mistake lol

seancorfield23:05:47

@souenzzo I'd say Scala got there first with case classes...?

souenzzo23:05:51

I don't know about scala...

seancorfield23:05:31

case classes date back to around 2008 in Scala I think? Looking at Clojure's change log, defrecord came in 1.2 which was released in late 2010.

👍 4
seancorfield23:05:09

(at least the documentation I found for case classes in Scala is dated 2008 so they may predate that)

seancorfield23:05:50

@lilactown I'd wager other FP languages had record-like types before even then... but they're also not really classes in the same way Scala/Clojure/etc have them.