News for hackers. Stuff that matters.

profdemarco

Re:Consider the Nimrod Programming Language on Wednesday March 12, 2014 @11:03PM (#7389859)
Almost all the Haskell entries in the shootout are just using the FFI to call into C libraries. None of them are remotely close to idiomatic Haskell.
Re:Clojure vs. Scala on Tuesday December 24, 2013 @08:24PM (#6961837)
The reasons other than the ones I've outlined are caused by implementation details and wouldn't exist if they chose the correct abstractions.
Re:Clojure vs. Scala on Tuesday December 24, 2013 @02:14PM (#6960690)
CanBuildFrom is essentially a typeclass in Scala that is used for converting between collection types. Ignoring the coherency issues associated with using implicits for typeclasses, it makes the implementation of the collections library significantly more complicated and causes issues with type inference.

In the rare cases where you actually need to convert between collection types, it's usually trivial and more efficient to do it manually. Essentially they've added tons of complexity for negligible benefit. One of my main gripes with the Scala collections library is that it's overly complex and that this complexity has been the source of hundreds of bugs.

If there was any real benefit to the way it's currently done they wouldn't be hiding the true type signature for things like `List.map` in the official Scaladocs.

Re:Clojure vs. Scala on Tuesday December 24, 2013 @01:36PM (#6960534)
They were (or are) being deprecated because they were broken beyond repair. That's pretty damning considering that all of the things I mentioned have been done properly in plenty of other languages. They aren't treading new ground here.

> Akka actors (which are awesome, BTW).

PartialFunction[Any, Unit]. Ridiculous.

Re:Clojure vs. Scala on Tuesday December 24, 2013 @11:32AM (#6959993)
That's part of Clojure's implementation in Java and the alternative would be to use reflection (obviously a terrible idea). There is similar code in the Scala implementation for dealing with functions, case classes and tuples. The only difference is that the Clojure implementation reflects that it's dynamically typed. I'd even bet there's similar code in CPython.
Re:Clojure vs. Scala on Tuesday December 24, 2013 @10:03AM (#6959573)
> it combines the safety of Haskell with the flexibility of Clojure

Foldable, Traversable, Monoid etc. are all far better abstractions than what Scala collections provide, and they don't lead to unmanageable inheritance hierarchies and ridiculous APIs. How many bugs have been caused by that? A few hundred maybe? Does Set equality work in the current release or is that broken again? Is it possible to do thread safe efficient merges in immutable collections yet?

The only thing Scala collections offers that Haskell doesn't is the CanBuildFrom travesty. At least in Clojure you can chain transformations together without generating tons of intermediate values. In Scala you're forced to choose between being ridiculously inefficient or using iterators.

Re:Clojure vs. Scala on Tuesday December 24, 2013 @09:49AM (#6959525)
You use an iterator, which has its own caveats, or you simply accept that chaining collection transformations is going to be ridiculously inefficient.
Re:Clojure vs. Scala on Tuesday December 24, 2013 @07:34AM (#6959171)
> Scala gives you are a much faster way to achieve the level of reliability you need than the level of testing you need in a less typed language

I have serious doubts about this since practically everything in the Scala standard library is horribly broken (collections, views, everything in scala.io, scala.xml and scala.actors etc.). The number of bugs found by Paul Phillips alone is absolutely ludicrous.

As it stands now, both Haskell and Clojure have vastly superior libraries, build systems that actually work, and implementations that people actually understand and can modify.