[2.0-scala] Extract the JSON library?

Showing 1-6 of 6 messages
[2.0-scala] Extract the JSON library? Alex Dean 1/19/13 4:21 PM
Hi,

A bit of a random one this - it feels like Play 2.0 now has includes one of two best JSON libraries in Scala land (Jerkson is abandonware, which leaves the other interesting one being https://github.com/json4s/json4s). And so I wondered: are there any plans to extract Play's JSON library and make it a standalone Typesafe library - a little like https://github.com/typesafehub/config for configuration.

No worries if not - but I hope the answer is yes, as I'm keen to use the library in non-Play projects (e.g. Scalding MapReduce jobs)...

Thanks,

Alex
Re: [play-framework] [2.0-scala] Extract the JSON library? Kim Stebel 1/19/13 9:38 PM
It might not be exactly what you are looking for, but spray-json is quite similar to Play's approach and is already a separate library.

--
 
 

Re: [play-framework] [2.0-scala] Extract the JSON library? Alex Dean 1/20/13 4:38 AM
Thanks for the link Kim - yep, JSON libraries are the Scala community's writing a todo list app, I think there are six or seven now? ;-)

I guess my point is, in the face of "JSON library proliferation", it would be nice to have an "official" Typesafe one, and the one within the Play Framework seems to be a perfectly good fit for this (it's based on Jackson and is strongly typesafe).

To play devil's advocate for a minute: either the Play JSON library is better than the alternatives (in which case it's only really fair to extract it and share it with the wider Scala community), or Play has fallen victim to NIH and should really be using one of the competing libraries...

Cheers,

Alex
Re: [play-framework] [2.0-scala] Extract the JSON library? James Roper 1/20/13 4:59 PM
I guess my point is, in the face of "JSON library proliferation", it would be nice to have an "official" Typesafe one, and the one within the Play Framework seems to be a perfectly good fit for this (it's based on Jackson and is strongly typesafe).

I don't think it's necessary to have an official Typesafe JSON library, and for something like a JSON library, where it's a problem domain with a small surface area and well defined boundaries, I think diversity is in fact very healthy.

To play devil's advocate for a minute: either the Play JSON library is better than the alternatives (in which case it's only really fair to extract it and share it with the wider Scala community), or Play has fallen victim to NIH and should really be using one of the competing libraries...

Given that macros are still considered an experimental feature of Scala, and Scala 2.10 has only been released for less than a month, I don't think this is a correct assessment of the situation.  It can't be NIH syndrome, since it was impossible for a macro based JSON solution to exist before Scala macros existed, and we wanted a macro based JSON library in Play, so we had to implement it ourselves.  On whether the Play JSON library is better than the alternatives, the jury is still out on that.  The JSON macros are still considered experimental.  Until we get heavy real world use of them, I don't think we can make that call.  Don't get me wrong, of course we think that it's the best Scala JSON library out there, but let's not jump to conclusions too soon.
 

Cheers,

Alex

On Sunday, January 20, 2013 5:38:54 AM UTC, Kim Stebel wrote:
It might not be exactly what you are looking for, but spray-json is quite similar to Play's approach and is already a separate library.

On Sun, Jan 20, 2013 at 1:21 AM, Alex Dean <al...@snowplowanalytics.com> wrote:
Hi,

A bit of a random one this - it feels like Play 2.0 now has includes one of two best JSON libraries in Scala land (Jerkson is abandonware, which leaves the other interesting one being https://github.com/json4s/json4s). And so I wondered: are there any plans to extract Play's JSON library and make it a standalone Typesafe library - a little like https://github.com/typesafehub/config for configuration.

No worries if not - but I hope the answer is yes, as I'm keen to use the library in non-Play projects (e.g. Scalding MapReduce jobs)...

Thanks,

Alex

--
 
 

--
 
 



--
James Roper
Software Engineer

Typesafe - The software stack for applications that scale
Twitter: @jroper
Re: [play-framework] [2.0-scala] Extract the JSON library? Alex Dean 1/21/13 4:21 AM
Hi James,

I hadn't appreciated the macro-based/experimental nature of the Play JSON library. In that case, it definitely makes to hold off from extracting and see how it scales in the real-world.

for something like a JSON library, where it's a problem domain with a small surface area and well defined boundaries, I think diversity is in fact very healthy.

I disagree - the vast majority of programming languages/environments have a bundled/"batteries included" JSON library plus 0-3 alternate competing implementations. Scala having no official JSON library and 6-7 alternate libraries is not healthy diversity, it's just confusing and leads to major projects like Scalding using abandonware (Jerkson), and apps bundling 2 or 3 different JSON libraries because their component library authors' drew different JSON libraries out of the hat.

The other trouble is that 6-7 different implementations means 6-7 (very slightly different) ASTs, which actually makes it impossible for an app or library to robustly expose a standard `JsonObject` or similar to other software.

If Typesafe is happy with the JSON proliferation, perhaps at least Play's JSON implementation should move to support json4s, which is trying to do something to standardise JSON in Scala:


 
To play devil's advocate for a minute: either the Play JSON library is better than the alternatives (in which case it's only really fair to extract it and share it with the wider Scala community), or Play has fallen victim to NIH and should really be using one of the competing libraries...

Given that macros are still considered an experimental feature of Scala, and Scala 2.10 has only been released for less than a month, I don't think this is a correct assessment of the situation.  It can't be NIH syndrome, since it was impossible for a macro based JSON solution to exist before Scala macros existed, and we wanted a macro based JSON library in Play, so we had to implement it ourselves.  On whether the Play JSON library is better than the alternatives, the jury is still out on that.  The JSON macros are still considered experimental.  Until we get heavy real world use of them, I don't think we can make that call.  Don't get me wrong, of course we think that it's the best Scala JSON library out there, but let's not jump to conclusions too soon.
 

Cheers,

Alex

On Sunday, January 20, 2013 5:38:54 AM UTC, Kim Stebel wrote:
It might not be exactly what you are looking for, but spray-json is quite similar to Play's approach and is already a separate library.

On Sun, Jan 20, 2013 at 1:21 AM, Alex Dean <al...@snowplowanalytics.com> wrote:
Hi,

A bit of a random one this - it feels like Play 2.0 now has includes one of two best JSON libraries in Scala land (Jerkson is abandonware, which leaves the other interesting one being https://github.com/json4s/json4s). And so I wondered: are there any plans to extract Play's JSON library and make it a standalone Typesafe library - a little like https://github.com/typesafehub/config for configuration.

No worries if not - but I hope the answer is yes, as I'm keen to use the library in non-Play projects (e.g. Scalding MapReduce jobs)...

Thanks,

Alex

--
 
 

--
 
 



--
James Roper
Software Engineer

Typesafe - The software stack for applications that scale
Twitter: @jroper
Re: [play-framework] [2.0-scala] Extract the JSON library? Pascal 1/21/13 6:10 AM
By the way, JSon macros are just tools built on top of JSon API.
So yes it's experimental but it's not mandatory to use them if you want to have something more stable.

Regards
Pascal

--