News for hackers. Stuff that matters.
Re:When Haskell Is Not faster than C by dschiptsov on Tuesday January 22, 2013 @03:09AM (#5096117)
I think the sytnax of Erlang is much more elegant, because it was build around the fundamental idea of pattern matching as a core feature of the language.

When you have a few good ideas put together, you could get an elegant solution. When you just stuff everything inside (like Clojure) or went to extremes (like Haskell) all you got is just a mess.

Erlang syntax, however, is noisy due to all those punctuation, but it is elegant nevertheless.

  map(Fun, [H|T]) -> [Fun(H)|map(Fun, T)];
  map(Fun, []) -> [].
 
  member(H, [H|T]) -> true;
  member(H, [_|T] -> member(H, T);
  member(H, []) -> false.
This is intuitive, readable, but noisy.)
Re:When Haskell Is Not faster than C by pohl on Tuesday January 22, 2013 @05:56AM (#5096519)
I'm not sure I follow you. Is the pattern-matching in Haskell somehow not 'core' enough? Both qsort examples linked in this thread use pattern matching.
Re:When Haskell Is Not faster than C by dschiptsov on Tuesday January 22, 2013 @12:58PM (#5098495)
All I'm trying to say that Erlang syntax is much more intuitive and readable, being derived from Prolog.

I honestly can't see why should I use Haskell (except for being so clever) when I have Erlang, or at least one real advantage.

Re:When Haskell Is Not faster than C by mwotton on Tuesday January 22, 2013 @04:24PM (#5099682)
well, let's look.

map f (h:t) = f h:map f t

map f [] = []

member x (h:t) = x == h || member x t

member _ [] = False

I think the only difference is that you can't match for equality directly in the pattern.