News for hackers. Stuff that matters.
Re:Nim 1.0 by danielecook on Monday September 23, 2019 @05:40PM (#21054021)
I stumbled onto nim because a sequencing-data (DNA/RNA/etc) library was written for it (https://github.com/brentp/hts-nim). In addition to Go, it's been a great way to learn a compiled language. It's fast, easy to use, and has a friendly community.
Re:Nim 1.0 by vasili111 on Monday September 23, 2019 @06:34PM (#21054490)
How good is nim performance with sequencing-data in comparision with other programming languages you used for it before?
Re:Nim 1.0 by TylerE on Monday September 23, 2019 @09:16PM (#21055502)
Nim performance is really really good. Like, maybe C - 5%. Comparable with stuff like Rust or D... way way faster than Go or anything interpreted.
Re:Nim 1.0 by neverartful on Monday September 23, 2019 @11:06PM (#21056118)
I think it depends on the nature of the code.

For a side project of mine, I recently re-wrote the same code in a dozen or so languages. The application reads input data from text file and does a bunch of conversions to integers and floats (atoi and atof). It then runs through an algorithm that does calculations and identifies proper actions. Finally, it writes the output data as formatted text file. Regardless of implementation, it runs quick. Sorry I can't provide more details on nature of the code (it has IP that belongs to another person).

Here are the top 10 best execution times (all run on same hardware). Times obtained by 'time' utility (e.g., "time ./run.sh"). Some of these were run on Ubuntu 16.04 and a few were run on FreeBSD 11.2. Where the compiler has optimization flags, I used it.

1. C++ 0.04 (gcc version 5.4.0) 2. Rust 0.11 (version 1.37.0) 3. Go 0.13 (version 1.12.7) 4. D 0.16 (tied with Pascal) (DMD64 D Compiler v2.073.2-devel) 5. Pascal 0.16 (tied with D) (fpc 3.0.2) 6. C# 0.25 (mono 4.8.1) 7. Nim 0.50 (1.0.0) 8. Kotlin 0.81 (Kotlin version 1.3.50-release-112, JRE 1.8.0_222) 9. Java 0.95 (openjdk version "1.8.0_131") 10. Scala 1.79 (version 2.12.2, running on 1.8 openjdk)

Re:Nim 1.0 by neverartful on Tuesday September 24, 2019 @02:10AM (#21057019)
Replying to my own post to provide better formatting of execution times.

  1. C++     0.04  (gcc version 5.4.0)
  2. Rust    0.11  (version 1.37.0)
  3. Go      0.13  (version 1.12.7)
  4. D       0.16  (tied with Pascal) (DMD64 D Compiler v2.073.2-devel)
  5. Pascal  0.16  (tied with D) (fpc 3.0.2)
  6. C#      0.25  (mono 4.8.1)
  7. Nim     0.50  (1.0.0)
  8. Kotlin  0.81  (Kotlin version 1.3.50-release-112, JRE 1.8.0_222)
  9. Java    0.95  (openjdk version "1.8.0_131")
  10. Scala  1.79  (version 2.12.2, running on 1.8 openjdk)
Re:Nim 1.0 by deorder on Tuesday September 24, 2019 @04:54AM (#21057876)
I am pretty sure it should be very close to or the same as C++. Ask around on the Nim forum.
Re:Nim 1.0 by littlestymaar on Tuesday September 24, 2019 @07:47AM (#21058921)
And the x2 difference between C++ and Rust looks suspicious too.
Re:Nim 1.0 by nfrankel on Tuesday September 24, 2019 @02:12AM (#21057036)
Obviously, if you measure cold starts, JVM-based languages will be slower...
Re:Nim 1.0 by neverartful on Tuesday September 24, 2019 @02:22AM (#21057089)
Agreed. I include them in the list as a matter of completeness.
Re:Nim 1.0 by PMunch on Tuesday September 24, 2019 @02:42AM (#21057188)
Surprised to see Nim that slow, typically it ranks much higher in benchmarks. But without looking at the code and compiler options its hard to tell if it is simply the problem or the implementation that's to blame.
Re:Nim 1.0 by nimmer on Tuesday September 24, 2019 @04:47AM (#21057848)
There are many other benchmarks around where Nim is usually quite close to C. Perhaps Nim was not compiled in release mode.
Re:Nim 1.0 by squarefoot on Tuesday September 24, 2019 @08:53AM (#21059547)
or possibly was a line-to-line translation of the original test without using any peculiarities of Nim.
Re:Nim 1.0 by nickitolas on Wednesday September 25, 2019 @07:45AM (#21069763)
I'm very surprised to see rust that slow. Could you share at east parts of your code?
Re:Nim 1.0 by danielecook on Monday September 23, 2019 @07:14PM (#21054785)
I have only used python (check out cyvcf2 by brentp!), R, and bash previously - so nothing else really compiled (its faster than these in general). But my guess is that you will have an easier time writing nim than the alternatives, and after that it is easy to optimize once you have basic functionality.
Re:Nim 1.0 by totalperspectiv on Monday September 23, 2019 @07:27PM (#21054874)
That's exactly how I found it as well. Brent has some really high quality bioinformatics libraries written in Nim, and supports them well.