7 ms·
So, XML, YAML, JSON, and the dozen plus other markup notations were not suitable because they used C style delimiters instead of Lisp style delimiters? Snark a
by falcolas 14y ago
So, XML, YAML, JSON, and the dozen plus other markup notations were not suitable because they used C style delimiters instead of Lisp style delimiters?
Snark aside, what does this buy us that these existing markup languages don't?
I appreciate all that Rich Hickey does for programmers, but aside from his name, this just adds to the noise that already exists in this domain.
- mattdeboard 14y agoI suspect it's just a tool, and the Datomic folks thought they'd make it available. No one said it was going to change the world, right? What does it buy "us"? Well, it doesn't buy "us" anything. They needed a data interchange format and I assume it made more sense to use Clojure's primitives than parsing up JSON. Why would a project written using a homoiconic language use anything but that language to exchange data between its components? edit: Said best by this tweet by fogus: "Clojure devs have been using #Clojure data as an interchange format all along. ..." https://twitter.com/fogus/status/243913831242399744 https://twitter.com/fogus/status/243913831242399744
- d0m 14y agoI suppose the "buy us" part was meant because it was the first rank on HN. (I.e. As if it's a big deal.)
- dmix 14y agoPlenty of language / tookit specific articles reach the top of HN. There are quite a few people here interested in clojure and Rich Hickey's work.
- lloeki 14y ago> They needed a data interchange format and I assume it made more sense to use Clojure's primitives than parsing up JSON. Even in JavaScript it's better to parse JSON instead of eval'ing, because you don't want to execute stuff that would "happen" to be contained in the data interchange format.
- lucian1900 14y agoThey aren't evaluated in Clojure, they are read by the reader.
- Tuna-Fish 14y agoThe word REPL comes from lisp and means Read Eval Print Loop. The significance is that unlike in, say, python, Read and Eval are separate. Read reads a string and turns it into an in-memory data structure, Eval takes a data structure (not a string!) and evaluates it. Using Read in a lisp is typically safe, so long as you turn off reader macros and the like.
- lloeki 14y ago> The significance is that unlike in, say, python, Read and Eval are separate. They are separate: * http://docs.python.org/library/ast.html#ast.parse * http://docs.python.org/library/ast.html#ast.literal_eval
- mcav 14y agoAbove JSON: Sets, keywords, integer type, hashmaps in which the key doesn't have to be a string, extensible data types (most of which jacobolus points out as well)
- btilly 14y agoYou say above, I say portability problem. JSON is a lowest common denominator. The features that you just specified are not directly available in JavaScript. Therefore data represented in this new format will be very, very clunky to access from JavaScript.
- tincholio 14y agoThat says more about Js than about this format
- josteink 14y agoWell. That's a limitation of Javascript and not a problem with EDN as such. Besides, without highlighting Javascript's limitations, how will we ever get it to improve?
- btilly 14y agoIf improvement in JavaScript, which sits in browsers that developers have no control over, is a prerequisite for the success of a protocol, that protocol will be irrelevant in the web world. In general when you're trying to achieve interoperability, any features and distinctions supported in your data format that are available in one language and not in another will be causes of interoperability problems. For instance with JSON, the format allows you to differentiate between values that are numbers and values that are strings. Languages like PHP, Perl and JavaScript do not particularly care about that distinction, and therefore coding values consistently is hard in those languages. (You can guess, but sometimes guess wrong - your zip codes are usually represented as numbers and sometimes strings.) Languages like Ruby and Python do care about the distinction, and so applications can have difficulty accepting JSON from the previous languages. This new format allows more places for this kind of issue to exist. We have distinction between different types of integers. We have symbols (2 kinds if you have them). We have sets. We have 2 different kinds of lists. And we have a plethora of possible extensions, every one of which can behave differently in different implementations. When both sides speak Clojure, this is going to be a very convenient choice. When they don't, every one of these obvious features is going to be a source of headaches down the road. That is why data exchange formats should be in a least common denominator between the languages in question.
- batgaijin 14y agoIt's absolutely insane that sexpressions didn't take over. I blame people hating lisp for no reason and supporters of lisp for being antisocial.
- jahewson 14y agoReally? I presumed it was just because they can't be read left-to-right like English.
- jcromartie 14y agoHow so? Prefix notation reads left-to-right nicely when you are dealing with verbs. Boolean logic is less natural, but also makes up much less of my programs (especially when using functional patterns like predicates, map, reduce, filter, etc.). I also think that while Boolean expressions in Lisp are less natural than "this AND that OR another", they are clearer when they get large (with good formatting of course).
- jahewson 14y agoIn English we say 1 + 2 * 3 as "one plus two times three": 1 + 2 * 3 one plus two times three But in Lisp when read naïvely left-to-right this becomes "times add one two three", which is nonsense in English. (* (+ 1 2) 3) times add one two three Most people cite "lots of brackets" as their reason for disliking s-expressions, but I think the unfamiliar ordering is a less superficial criticism. Of course, for those of us manipulating ASTs they're very natural, because we see language as trees.
- randallsquared 14y agoBut in Lisp when read naïvely left-to-right this becomes "times add one two three", which is nonsense in English. So, "the product of the sum of 1 and 2, and 3"? Reads fine in English, as long as you refer to the results instead of describing what to do. :)
- 14y ago
- josteink 14y agoFrom what I can tell, not much, but it adds another form of extension (via tags) which you can arguably say you also had in XML (via namespaces). Other than that, the major difference seems to be that EDN does not have a root-element or requirement for such, and as mentioned in the introduction can be used for streaming and real-time content etc.
- Lexarius 14y agoThe tags remind me of the tag support in YAML. YAML does have top-level elements, but the document break marker "---" gives you a stream of documents.
- kinleyd 14y agoStuart Halloway mentioned in one of his talks that SOAP, iirc, did way too much and that as a reaction to that, JSON went too far in the bare bones direction. Looks like edn is the balance Rich Hickey and associates have struck. From a Clojure programmer point of view, I like what I see.