News for hackers. Stuff that matters.
Re:What can Rust do for astrophysics? by Devid2014 on Monday February 13, 2017 @09:04AM (#13635226)
https://github.com/marblestation/benchmark-leapfrog

This are not valid benchmarks at all. What is the point to run N-Body sim with all particles set to 0.0 ?

Where is the result of the sim ?

Why it will be not validated at all ?

To make this look like real benchmark one will need to use the same start condition and then validate that result for all languages is the same.

It would be great to have C++ code using Eigen library for example ? To show the difference .

Also this is naive O(N^2) sim that could be speed up using Fast multipole method (FMM), but of course this would be much more complicated to do this in Rust or Go as in C++.

Re:What can Rust do for astrophysics? by semi-extrinsic on Monday February 13, 2017 @12:47PM (#13637189)
As others have pointed out, adding insult to injury, in the Rust version the bulk of the actual calculation is optimized out completely! Adding a print at the end increases the runtime by an order of magnitude.

The Rust community is actively hurt by people doing things like this, no-one takes this type of work seriously.

Edit: please come back when you've replicated and validated at least something like a basic, well-understood finite difference solver of single-phase incompressible Navier-Stokes, and shown that it's either equivalently fast and much easier code, or significantly faster (very unlikely). Do note that a readable Fortran version is going to be ~400 lines, so there's not a terribly large room for improvement. Also, we already have a good language that gives us slower and much easier code, namely Python.

Re:What can Rust do for astrophysics? by thebooktocome on Monday February 13, 2017 @11:25AM (#13636453)
I wouldn't bet that FMM is more complicated to implement in Rust as in C++.
Re:What can Rust do for astrophysics? by Devid2014 on Monday February 13, 2017 @03:08PM (#13638288)
For me Rust has a lot of potential to write more secure code in places where it is needed but astrophysics is may be not one of them.

Not sure about language it self, my knowledge about Rust is limited. But st is at least harder because we already have optimized libraries that can do this in C++.

Do some one know such library for Rust ? It would be great too look at it.

Re:What can Rust do for astrophysics? by acqq on Monday February 13, 2017 @12:32PM (#13637048)
Indeed, the code that was initially published apparently didn't even output any results, and that can be optimized to "do nothing, return"?
Re:What can Rust do for astrophysics? by marblestation on Monday February 13, 2017 @11:09PM (#13641063)
The code has now been improved with all the suggestion friendly made by the Hacker news and Rust subreddit communities. Thanks!
Re:What can Rust do for astrophysics? by semi-extrinsic on Tuesday February 14, 2017 @10:38AM (#13644229)
I just had a look at the Fortran code, and oh boy, it's not pretty, and far from "canonical" Fortran. I will submit a PR (hopefully later tonight) that makes it less ugly and slow.

(Protip: don't use if's inside tight loops. Just don't.)

Re:What can Rust do for astrophysics? by semi-extrinsic on Tuesday February 14, 2017 @05:51PM (#13648060)
Update: just sent you a PR that reduces the amount of code by ~70% while increasing the speed by ~30% for the Fortran version.
Re:What can Rust do for astrophysics? by marblestation on Wednesday February 15, 2017 @08:37AM (#13651861)
Merged! Thank you very much :-)