Here is a curated list of the Benchmarks Game pidigits results.

Every programs calling the gmp library have been removed because first it’s almost like cheating and second I wanted to see how really could fare the language in this pure single threaded integer type of calculation. I also removed all “dialectal variations” from the same language, keeping only the best one in this benchmark. The algorithm is simple, very well known and you can’t really get over it.

If we get the “low level languages” like Chapel and C/C++ out of the picture, then Haskell, Julia, Ocaml are really very good contenders as high level languages, but Julia high level memory consumption is a little daunting (Ok, Java’s one is insane). I’m really disapointed about F#, which couldn’t even do better than good ol’ grand’pa lisp.

>
× source secs mem gz busy cpu load
1 Chapel 1.63 6,180 501 1.68 99% 1% 2% 1%
2 C gcc 1.75 2,660 452 2.02 1% 100% 14% 1%
3 C++ g++ 1.89 4,460 513 1.97 100% 2% 2% 1%
4 Haskell GHC 4.20 10,248 379 5.32 86% 9% 8% 23%
5 Julia 4.91 192,912 275 5.50 3% 6% 4% 99%
6 OCaml 6.74 20,020 458 6.84 1% 1% 100% 0%
7 Dart aot 11.07 90,996 500 11.41 99% 1% 1% 2%
8 Node js 13.48 63,808 530 13.66 1% 0% 100% 0%
9 Erlang HiPE 13.82 47,588 562 16.92 42% 56% 8% 17%
10 VW Smalltalk 15.00 54,968 753 15.59 3% 0% 55% 46%
11 Java 19.39 361,624 800 21.09 44% 2% 50% 12%
12 Lisp SBCL 22.08 127,992 648 22.42 100% 1% 0% 0%
13 F# .NET Core 24.51 80,556 701 26.37 11% 41% 45% 11%
14 JRuby 24.89 764,728 518 35.26 79% 14% 19% 32%
15 Free Pascal 25.23 652 3060 25.49 0% 1% 100% 0%