Hacker Newsnew | comments | show | ask | jobs | submit login
Python’s Valentines Day Gift to Clojure (sunng.info)
80 points by sunng 1263 days ago | 12 comments



I have to say, after tinkering with Clojure, when I'm typing out a python dict or list I think, "So many damn commas..."

-----


Try this:

>>> dict(user='root', password='secret') {'password': 'secret', 'user': 'root'} >>> "marry had a little lamb".split() ['marry', 'had', 'a', 'little', 'lamb']

-----


Some (potential) context to this is that at Clojure Conj there was a discussion of the potential for clojure expressions to become a standard data serialization format. The idea is that clojure data is significantly more rich than something like JSON.

In fact, as I understand it, some of the changes to the reader in 1.4 are aimed at working on this goal. You can read a little about this at http://dev.clojure.org/pages/viewpage.action?pageId=950382

-----


Was it purely coincidence that this was posted the same day as PyClojure? http://news.ycombinator.com/item?id=3589374 https://github.com/eigenhombre/PyClojure

-----


why do people want to do this?

-----


Same reason people use different programming languages in general, they just prefer/like/forced/are used to it.

If you like clojure and must program in python, have an idea of how to implement something in clojure but not in python then just use clojure now.

-----


It's a way to share data with a clojure application. And s-expressions are a pretty good format for data transfer so it's not a terrible idea to provide ways for people to use it as such.

-----


XML and Json are much more mature ideas for data sharing.

edit: google results for:

  "python xml" : 359,000
  "python json" : 48,600
  "python s-expression" : 5,440

-----


> XML and Json are much more mature ideas for data sharing.

How're they more mature than s-expressions? I don't think everything needs citations, but I'd like to see some supporting evidence for this particular claim.

-----


You probably don't need a citation to know that s-expressions have been around much longer than XML or JSON, for what that's worth.

-----


Why are "google results for python %s" a useful maturity metric here?

A better argument would have been showing that both xml and json can be parsed/generated through standard Python libraries. S-expressions don't support this behavior.

-----


I didn't say mature I said they were a good format for it. And by what metric are you measuring maturity?

   * Age? s-expressions predate python by a fair amount.
   * Parsers? just about every language I know has a lisp 
     interpreter embedded in it. s-expressions therefore    
     have 
     parsers in pretty much all languages.
   * Market Share? well xml and json may win there but I'm 
     not sure that's a valid reason to discount
     s-expressions

-----




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: