|
View:
New views
10 Messages
—
Rating Filter:
Alert me
|
|
|
[ANN] Literaljson 0.1JSON toolkit for Scala
http://github.com/jonifreeman/literaljson/tree/master Features: * DSL to create JSON * Quite fast parser, 200 times faster than standard Scala JSON parser according to one benchmark: http://github.com/jonifreeman/literaljson/tree/be575a9eda0f2cee75d2665ef48aa4abf601c06d/benchmark * Compact formatting * Pretty printing * XPath like queries Cheers, Joni |
|
|
Re: [ANN] Literaljson 0.1Joni Freeman wrote:
> JSON toolkit for Scala > http://github.com/jonifreeman/literaljson/tree/master Thanks! BTW, this doesn't tell me which JVM the benchmark was run with: Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode) Is it 1.5 or 1.6? The 11.0-b15 is the minor release of the Java release. You could include the entire java -version info. Regards, Blair |
|
|
Re: [ANN] Literaljson 0.1On Wed, 2009-07-08 at 10:56 -0700, Blair Zajac wrote:
> Joni Freeman wrote: > > JSON toolkit for Scala > > http://github.com/jonifreeman/literaljson/tree/master > > Thanks! > > BTW, this doesn't tell me which JVM the benchmark was run with: > > Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode) > > Is it 1.5 or 1.6? The 11.0-b15 is the minor release of the Java release. You > could include the entire java -version info. Oh, that's true. It was java6, full version info added: http://github.com/jonifreeman/literaljson/tree/3f4e0b08ebae3bb731a21000e53bc4fce0a7d2a0/benchmark Cheers, Joni |
|
|
Re: [ANN] Literaljson 0.1Any benchmark against Jackson?
On Wed, Jul 8, 2009 at 1:39 PM, Joni Freeman <joni.freeman@...> wrote: JSON toolkit for Scala -- Daniel C. Sobral Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value. |
|
|
Re: [ANN] Literaljson 0.1I'm not sure I like the implicit that adds "~" to Tuple2. I think this kind of stuff should either require a domain-specific type, or be defined inside a trait, so that it is easier to control it's scope.
On Wed, Jul 8, 2009 at 1:39 PM, Joni Freeman <joni.freeman@...> wrote: JSON toolkit for Scala -- Daniel C. Sobral Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value. |
|
|
Re: [ANN] Literaljson 0.1I agree that such implicit conversions should preferably be targeted for
more specific types. But I couldn't figure out any solution without sacrificing the readability of DSL. I'm open for any suggestions, the implementation is just a thin layer on top of AST and can be tweaked easily. The DSL is defined in object JsonDSL and needs to be imported into scope. Scala allows import statements in many places thus it is already possible to control the scope of those implicits (*). I'm not sure what would it buy to move the definitions inside a trait. Or am I missing something? (*) object scopetest extends Application { println("hello") { import literaljson.JsonDSL._ val foo = ("foo" -> 1) ~ ("bar" -> 2) println(foo) } println("world") } Cheers Joni On Wed, 2009-07-08 at 17:26 -0300, Daniel Sobral wrote: > I'm not sure I like the implicit that adds "~" to Tuple2. I think this > kind of stuff should either require a domain-specific type, or be > defined inside a trait, so that it is easier to control it's scope. > > On Wed, Jul 8, 2009 at 1:39 PM, Joni Freeman <joni.freeman@...> > wrote: > JSON toolkit for Scala > http://github.com/jonifreeman/literaljson/tree/master > > Features: > > * DSL to create JSON > * Quite fast parser, 200 times faster than standard Scala JSON > parser > according to one benchmark: > http://github.com/jonifreeman/literaljson/tree/be575a9eda0f2cee75d2665ef48aa4abf601c06d/benchmark > * Compact formatting > * Pretty printing > * XPath like queries > > Cheers, Joni > > > > > > > -- > Daniel C. Sobral > > Something I learned in academia: there are three kinds of academic > reviews: review by name, review by reference and review by value. |
|
|
Re: [ANN] Literaljson 0.1Yes, Jackson is faster:
http://github.com/jonifreeman/literaljson/tree/13607aba8dce9769bfcf717319459db18080a887/benchmark I'm pretty sure there's a few optimizations which could bring Literaljson closer to Jackson though. Cheers Joni On Wed, 2009-07-08 at 16:10 -0300, Daniel Sobral wrote: > Any benchmark against Jackson? > > On Wed, Jul 8, 2009 at 1:39 PM, Joni Freeman <joni.freeman@...> > wrote: > JSON toolkit for Scala > http://github.com/jonifreeman/literaljson/tree/master > > Features: > > * DSL to create JSON > * Quite fast parser, 200 times faster than standard Scala JSON > parser > according to one benchmark: > http://github.com/jonifreeman/literaljson/tree/be575a9eda0f2cee75d2665ef48aa4abf601c06d/benchmark > * Compact formatting > * Pretty printing > * XPath like queries > > Cheers, Joni > > > > > > > -- > Daniel C. Sobral > > Something I learned in academia: there are three kinds of academic > reviews: review by name, review by reference and review by value. |
|
|
Re: [ANN] Literaljson 0.1Oh, the trait thing is just an implicit import of implicits. :-) It forces the scope to be a class or object, though.
The only suggestion I can think of is creating a JSON "Nil" json object, so that every json expression would be started like "JSON ~ ...", thus foregoing the need for an implicit. Naturally, "~" in object JSON would be defined as returning a json instance of the pair/list to it's right.
Does that make sense? Do you feel it would overburden the syntax? On Thu, Jul 9, 2009 at 1:36 AM, Joni Freeman <joni.freeman@...> wrote: I agree that such implicit conversions should preferably be targeted for -- Daniel C. Sobral Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value. |
|
|
Re: [ANN] Literaljson 0.1Hi Daniel,
I'm not sure if introducing Nil object would be enough. It isn't clear where Nil object(s) should be inserted for instance in this example case. ("person" -> ("name" -> "Joe") ~ ("age" -> 35) ~ ("spouse" -> ("person" -> ("name" -> "Marilyn") ~ ("age" -> 33) ) ) ) Cheers Joni On Thu, 2009-07-09 at 12:31 -0300, Daniel Sobral wrote: > Oh, the trait thing is just an implicit import of implicits. :-) It > forces the scope to be a class or object, though. > > > The only suggestion I can think of is creating a JSON "Nil" json > object, so that every json expression would be started like "JSON > ~ ...", thus foregoing the need for an implicit. Naturally, "~" in > object JSON would be defined as returning a json instance of the > pair/list to it's right. > > > Does that make sense? Do you feel it would overburden the syntax? > > On Thu, Jul 9, 2009 at 1:36 AM, Joni Freeman <joni.freeman@...> > wrote: > I agree that such implicit conversions should preferably be > targeted for > more specific types. But I couldn't figure out any solution > without > sacrificing the readability of DSL. I'm open for any > suggestions, the > implementation is just a thin layer on top of AST and can be > tweaked > easily. > > The DSL is defined in object JsonDSL and needs to be imported > into > scope. Scala allows import statements in many places thus it > is already > possible to control the scope of those implicits (*). I'm not > sure what > would it buy to move the definitions inside a trait. Or am I > missing > something? > > (*) > object scopetest extends Application { > println("hello") > > { > import literaljson.JsonDSL._ > val foo = ("foo" -> 1) ~ ("bar" -> 2) > println(foo) > } > > println("world") > } > > > Cheers Joni > > > On Wed, 2009-07-08 at 17:26 -0300, Daniel Sobral wrote: > > I'm not sure I like the implicit that adds "~" to Tuple2. I > think this > > kind of stuff should either require a domain-specific type, > or be > > defined inside a trait, so that it is easier to control it's > scope. > > > > On Wed, Jul 8, 2009 at 1:39 PM, Joni Freeman > <joni.freeman@...> > > wrote: > > JSON toolkit for Scala > > > http://github.com/jonifreeman/literaljson/tree/master > > > > Features: > > > > * DSL to create JSON > > * Quite fast parser, 200 times faster than standard > Scala JSON > > parser > > according to one benchmark: > > > http://github.com/jonifreeman/literaljson/tree/be575a9eda0f2cee75d2665ef48aa4abf601c06d/benchmark > > * Compact formatting > > * Pretty printing > > * XPath like queries > > > > Cheers, Joni > > > > > > > > > > > > > > -- > > Daniel C. Sobral > > > > Something I learned in academia: there are three kinds of > academic > > reviews: review by name, review by reference and review by > value. > > > > > > -- > Daniel C. Sobral > > Something I learned in academia: there are three kinds of academic > reviews: review by name, review by reference and review by value. > |
|
|
Re: [ANN] Literaljson 0.1I see the problem. Indeed, it would require adding the "Nil" object in many places, which would certainly detract from the DSL.
Ok, then, I have no other suggestions. :-)
On Mon, Jul 13, 2009 at 5:32 AM, Joni Freeman <joni.freeman@...> wrote: Hi Daniel, -- Daniel C. Sobral Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value. |
| Free embeddable forum powered by Nabble | Forum Help |