Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sure, but the point is to say, "This small body of code gives you a naive but fully functional mapreduce." You have a lot of time to give it all the trimmings while other possible implementations just get off the ground and get tested.


The first 40 Fibonacci numbers are calculated on my laptop under 5 milliseconds using the Erlang code below, i.e. more then 2000 times faster then his measured 10.xxx second on an 8 core server. Erlang has an edge for sure, but you need to implement that few lines in a proper and efficient way to prove it and a meaningful test is a must.

  ffib(0) -> [0];
  ffib(1) -> [0, 1];
  ffib(N) when N > 0 -> ffib([1, 1, 0], 2, N).

  ffib(R, N, N) -> lists:reverse(R);
  ffib([H1, H2 | _] = Prev, C, N) ->
    ffib([H1+H2 | Prev], C+1, N).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: