News for hackers. Stuff that matters.

nikita-volkov

It might be the case that your memory usage data on "aeson" is outdated. Prior to some later releases it was rendering in two passes: first into AST (the Value type) than from that into ByteString (Builder). It's likely that your extended memory usage was coming from that. Later they had the `Encoding` abstraction introduced to avoid that 2-pass problem. Both "jsonifier" and "buffer-builder" avoid that 2-pass problem by design.
I've updated the benchmarks to include "buffer-builder". It's not very different from "aeson".

    jsonifier/1kB          mean 2.087 μs  ( +- 260.0 ns  )
    jsonifier/6kB          mean 12.33 μs  ( +- 222.2 ns  )
    jsonifier/60kB         mean 118.3 μs  ( +- 1.991 μs  )
    jsonifier/600kB        mean 1.270 ms  ( +- 38.92 μs  )
    jsonifier/6MB          mean 20.53 ms  ( +- 1.042 ms  )
    jsonifier/60MB         mean 194.9 ms  ( +- 15.04 ms  )
    aeson/1kB              mean 6.542 μs  ( +- 199.2 ns  )
    aeson/6kB              mean 31.25 μs  ( +- 494.5 ns  )
    aeson/60kB             mean 261.7 μs  ( +- 8.044 μs  )
    aeson/600kB            mean 3.395 ms  ( +- 114.6 μs  )
    aeson/6MB              mean 30.71 ms  ( +- 701.0 μs  )
    aeson/60MB             mean 277.1 ms  ( +- 4.776 ms  )
    lazy-aeson/1kB         mean 6.423 μs  ( +- 83.69 ns  )
    lazy-aeson/6kB         mean 30.74 μs  ( +- 607.0 ns  )
    lazy-aeson/60kB        mean 259.1 μs  ( +- 4.890 μs  )
    lazy-aeson/600kB       mean 2.511 ms  ( +- 18.71 μs  )
    lazy-aeson/6MB         mean 24.92 ms  ( +- 95.36 μs  )
    lazy-aeson/60MB        mean 248.6 ms  ( +- 736.6 μs  )
    buffer-builder/1kB     mean 5.512 μs  ( +- 77.39 ns  )
    buffer-builder/6kB     mean 30.29 μs  ( +- 459.9 ns  )
    buffer-builder/60kB    mean 307.0 μs  ( +- 3.640 μs  )
    buffer-builder/600kB   mean 3.001 ms  ( +- 75.72 μs  )
    buffer-builder/6MB     mean 33.05 ms  ( +- 336.3 μs  )
    buffer-builder/60MB    mean 308.5 ms  ( +- 3.489 ms  )
And [one of those dogs](https://en.wikipedia.org/wiki/Soviet_space_dogs#Belka_and_St...).

I also plan to release "belka" as an HTTP client library mirroring the functionality later.

Thanks for the suggestion, but I don't seem to be able to change the title or to repost this. Do you know what to do in such cases?
Re:Refinement types in Haskell as a library on Tuesday April 28, 2015 @01:07AM (#9450602)
As it came up in the discussion at Reddit (http://www.reddit.com/r/haskell/comments/3425pk/refinement_t...), there at least exists "data-checked" (http://hackage.haskell.org/package/data-checked).
Re:Refinement types in Haskell as a library on Monday April 27, 2015 @11:36PM (#9450438)
> Also, what's up with that &? It doesn't seem to be a Prelude operator.

It's now in [Data.Function of "base"](http://hackage.haskell.org/package/base-4.8.0.0/docs/Data-Fu...) and hence in ["base-prelude"](http://hackage.haskell.org/package/base-prelude).

Re:I think I've solved the Haskell records problem on Monday January 19, 2015 @11:10AM (#8912453)
Actually Scala is the language I moved to Haskell away from. It turned out to be too messy and bloated for my taste. The syntax and the type inference are massively inferior to Haskell. An absolute majority of Scala's advanced features are just copycatted from Haskell (typeclasses, STM, Scalaz, the majority of the Shapeless library that you mentioned). The promoted usage applies it's object-orientation mostly only to encode a modular system (e.g., the cake pattern). A lot of things are simply impossible to achieve due to Scala not being purely functional.

So yes, Scala might have an edge over Haskell here and there, but IMO, as of a person who happens to have an extensive experience in Scala, in general it is majorly inferior compared to Haskell.

Re:I think I've solved the Haskell records problem on Sunday January 18, 2015 @11:01PM (#8910241)
There is a problem. I know no other language, which manages to have at the same a type system as powerful, abstractions as insightful, as good a support for concurrency and parallel programming, an ecosystem as rich and which performs as well.

Usable records are just an icing on the cake, but it's the cake that matters.