Hacker Newsnew | past | comments | ask | show | jobs | submit | defg's commentslogin

I have a few years of experiene with Haskell, and recently started Nimrod. It's an imperative language, so the differences are huge of course. I'm more productive in Nimrod. The syntax is great, similar to Python. Nimrod compiles to C without external dependencies, which makes it easy to deploy and easy to bind C libraries. Nimrod's metaprogramming is definitely worth checking out too.


Please be more explicit and specific. Are you saying that the Nimrod imperative style makes some problems easier to solve (can you give an example?), or does "productive" mean something else? What exactly is the metaprogramming good for?


I have also used Haskell in the past. Been using Nimrod for a couple of years now. I agree with defg: the differences are huge. But the great thing about Nimrod is how flexible it is. That's precisely where metaprogramming comes into play, while some features found in functional programming languages are missing from Nimrod they can be implemented fairly easily using Nimrod's macros. For example I have recently implemented syntax sugar for anonymous functions using macros (http://build.nimrod-lang.org/docs/future.html).

I do however find the imperative style of programming more efficient, when working with Haskell I always felt like I was fighting it. So perhaps Nimrod may not be for you, but it's still definitely worth checking out!



I was curious how a non-functional version would fare, so I wrote one in Nimrod and it's a lot faster than the functional C++: https://gist.github.com/def-/8187448ea7a5c8da8265

  Goats Wolves Lions    C++11  Nimrod
     17     55     6     0.00    0.00
    117    155   106     0.17    0.01
    217    255   206     0.75    0.01
    317    355   306     2.16    0.01
    417    455   406     5.28    0.01
    517    555   506    10.75    0.01
    617    655   606    19.15    0.02
    717    755   706    31.58    0.02
    817    855   806    46.52    0.02
    917    955   906    67.94    0.02
   1017   1055  1006    93.75    0.02
   2017   2055  2006   731.42    0.04


As some people noticed this was broken. Fixed version is not quite as fast, but still faster than functional C++:

  Goats Wolves Lions    C++11  Nimrod
     17     55     6     0.00    0.03
    117    155   106     0.17    0.13
    217    255   206     0.75    0.62
    317    355   306     2.16    1.89
    417    455   406     5.28    4.34
    517    555   506    10.75    8.42
    617    655   606    19.15   14.45
    717    755   706    31.58   23.04
    817    855   806    46.52   33.69
    917    955   906    67.94   48.57
   1017   1055  1006    93.75   65.25
   2017   2055  2006   731.42  500.95


And a functional version in Nimrod: https://gist.github.com/def-/ccef8bb54170b639c497


The important word here is "functional" C++. This is not about "fastest" C++. What does your comparison tell us?


That functional might not be the best damned paradigm on the planet for every use case? :)


It tells us that nimrod is pretty fast.


Argh, someone beat us to it. We have a massive-multiplayer tournament planned for Saturday: http://ddnet.tw/#news


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

Search: