5 ms·
Seems like you’re more interested in encoding your implementation details into a text document. This seems like something that could be left to the parser. Prov
by cmwelsh 6y ago
Seems like you’re more interested in encoding your implementation details into a text document. This seems like something that could be left to the parser. Provide the target types for the deserialization. This isn’t Python pickle or Java serialization - it’s a text string.
- deckeraa 6y agoFair enough. Though wouldn't that work better with languages like Java where the programmer typically ends up making a type or class for most things? With languages like Clojure it's fairly typical to declare no classes or types and to simply have your data structure be a composition of maps, sets, and vectors, etc. I suppose you could use your Clojure.spec keywords as the tag names in XML, but that's probably going to be more work than (clojure.edn/read-string (slurp "my-data.edn")). Could be an interesting option if you had to use XML as an interchange format.
- rcxdude 6y agoProblem is XML is extremely frequently used to represent such types (probably even more so than it's used to represent marked up text). And it's not very good at it.