6 ms·
Interesting that despite having what looks to me like Haskell and CL expertise, Slava's RethinkDB (various article describe as a "founder") seems to be written
by Erwin 14y ago
Interesting that despite having what looks to me like Haskell and CL expertise, Slava's RethinkDB (various article describe as a "founder") seems to be written in C++.
What do Haskell or CL implementation lack to be competitive with good old C++ there?
- ghc 14y agoWhen writing a database, performance is extremely important. Languages like C++ give you manual control of the computer's resources, which means you can count on predictable performance and memory management. Why is this important? All of your database code must be written with the performance characteristics of your data structures in mind. You need to know how long certain operations or memory swaps will take so that you can optimize data throughput. While CL and Haskell can be extremely fast and even outperform C++ in certain situations, the lack of manual resource management makes them ill suited to writing a database system. There are few, if any, applications where this matters so much.
- capisce 14y agoWhy can't we have the expressiveness of CL or Haskell with the performance of C++?
- jeremiep 14y agoWe do, its called the D programming language.
- shadowfox 14y agoThat feels a little surprising to me. Last time I looked at D it was nowhere close to CL or Haskell in expressiveness? (It was certainly better than C and less complicated than C++). Has there been significant improvements in the past couple of years?
- CountHackulus 14y agoThere really has. D 1.0 has 20 days of life left, and D 2.0 is really amazing. It has the C++ idea of "it's only there if you want it" but taken to an amazing degree. Yes, it's a little more verbose than most FP languages, but honestly, if you're interested in verbosity, go use J or Coke. The thing I like about D is that there's no surprises, everything works the way you'd expect it to. You can guess at what code should look like, and chances are it'll work.
- Peaker 14y agomap (head &&& length) . sort . group filterM (const [True, False]) Can you show how you implement these in D? If you want, I can explain these or give other examples of expressiveness I don't think you'll find in D.
- deleted 14y ago[deleted]
- tel 14y agoThat is one of the best implementations of powerset I've seen in a while. Thank you for that!
- roryokane 14y agoLinks explaining these Haskell code snippets: http://stackoverflow.com/a/10410997/578288 http://stackoverflow.com/a/10410997/578288 – the `map` snippet converts a flat list into a multiset represented as a list of `(count, element)` tuples http://stackoverflow.com/a/5378799/578288 http://stackoverflow.com/a/5378799/578288 – the `filterM` snippet returns the powerset of its list argument (http://en.wikipedia.org/wiki/Power_set http://en.wikipedia.org/wiki/Power_set)
- orlandu63 14y agoI think you mean group . sort
- Peaker 14y agoOops, quick-typing on my phone can have problematic results :-)
- gtani 14y agoCan you detail, or point to background info? There've been type system debates between proponents of Haskell, ocaml, SML, scala, and F#, i've never seen a D to Haskell comparison, and I've never seen D mentioned as a "free theorems" language. Maybe in this vid: http://channel9.msdn.com/Blogs/Charles/Alexandrescu-Bright-Meijer-Moran-Pure-versus-Native-and-much-more http://channel9.msdn.com/Blogs/Charles/Alexandrescu-Bright-M... Here's a scala to haskell http://www.cs.ox.ac.uk/jeremy.gibbons/publications/scalagp.pdf http://www.cs.ox.ac.uk/jeremy.gibbons/publications/scalagp.p...
- roryokane 14y agoWe can, theoretically. We just haven't yet developed algorithms that are clever enough to make the correct optimizations to code in enough of the cases where such optimizations are possible. There are patterns in our code that we humans can write out when we write our code in C++, but that we haven't yet formalized and implemented for the computer to do.
- Erwin 14y agoSo what unpredictable performance characteristics do CL & Haskell exhibit, that languages like Java or Erlang do not? Consider Neo4J, Cassandra, CouchDB, Riak, Voldemort, all major players in the current NoSQL world. All use Java & Erlang. Just how much computation does your database need to do, unless it's some special in-memory database like Redis? If you have your data on ordinary disks, you'll spend most of the time waiting for them.
- tel 14y agoSpace leaks are a big problem in Haskell that many neophytes and experts alike get massively caught up in—laziness is a double-edged sword.
- coffeemug 14y agoFor example, the RethinkDB coroutine engine is written in assembly. We couldn't come close to the same level of control in any other language. For systems programming C and/or C++ are still kings.
- lucian1900 14y agoHopefully Rust will soon become a viable alternative.
- deleted 14y ago[deleted]