Submitted June 11, 2017 at 11:34PM by 0xjnml
via reddit http://ift.tt/2sbQ7ox
“GHC.Generics is the modern way and it is much faster than SYB.” Say what?
I've been spending quite some time trying to reduce boilerplate in my Haskell code by building some generic functions. I first tried with Generics-SOP and found it too complex. I abandoned that and moved on to GHC.Generics. I eventually managed to understand how to "inspect the structure" of a type generically, but completely gave up when I tried to create a data constructor generically
Finally, I chanced upon Typeable and Data.Data and the simplicity of the interface/package was what I had been looking for! Why didn't I stumble upon this earlier?!
Then I tried to find out why there are TWO ways to do generic programming and what's different between them. Turns out, I'm not the only one with that question. The only answer to that StackOverflow question says the following:
GHC.Generics is the modern way and it is much faster than SYB.
Is there any data substantiating this claim? Is Data/Typeable slowed than GHC.Generic? How much slower? What other downsides does Data/Typeable have? Why is GHC.Generic considering "more modern"?
Submitted June 11, 2017 at 11:26PM by saurabhnanda
via reddit http://ift.tt/2sqZilO
I haven’t touched Scala in 2 years. What cool “new” stuff should I read up on?
Or rather, what cool new stuff from the last 2 years do you still think is cool?
Submitted June 11, 2017 at 10:22PM by brujoand
via reddit http://ift.tt/2rOXRMW
Ask /r/js: Has anybody compared Web Assembly Modules to C++ Addons in Node 8 performance-wise?
I'm wondering as to how much slower the current WASM on Node 8 is when compared to the C++ addons. Has anybody done any benchmarks on anything reasonably complex/"real world"?
In case you wonder why would we want to use WASM instead of native addons, few reasons: 1. we can use WASM in browsers too; 2. supporting WASM might prove easier; 3. if memory serves, there is some penalty associated with moving data in and out of V8 when native modules are used, and I wonder if moving types between WASM/JS is more efficient.
Submitted June 11, 2017 at 09:50PM by icharxo
via reddit http://ift.tt/2sR9CB1