Live data from Hacker News

What can Rust do for astrophysics?

arxiv.org

101–110 of 115 posts

Re: What can Rust do for astrophysics?

#101
post #83
post #77

Earlier quoted context omitted.

The programs on the site fit the rules defined on it, and the rules include the verification of the results: https://benchmarksgame.alioth.debian.org/why-measure-toy-ben... The OP doesn't even specify the rules for its own benchmark, as far as I understand doesn't verify the results? People here get NaNs? If the NaNs are produced as results, then the OP code is not measuring the speed of calculations at all but the s…

> The programs on the site fit the rules defined on it, and the rules include the verification of the results I'm not sure what you're refuting? Verifying that the results match is a necessary but insufficient quality for ensuring comparability. If the algorithm could be the same in each language but isn't (e.g. quicksort vs. bogosort), then that's not a valid comparison if your objective is to determine the overhead…

> The computer language benchmarks game was initially conceived to determine a ballpark for how slow interpreted and managed languages are compared to C.

Today the benchmarks game is referred to from the Rust FAQ. What is one to do?

https://www.rust-lang.org/en-US/faq.html#performance

Back in the previous millenia -- "[Doug Bagley's] goal was to compare all the major scripting languages. Then [Doug Bagley] started adding in some compiled languages for comparison…"

http://web.archive.org/web/20010125021400/http://www.bagley....

Re: What can Rust do for astrophysics?

#102
post #77
post #75

Earlier quoted context omitted.

>The N-Body on this site As noted elsewhere in here, the C implementation is using SSE, whereas the Rust implementation isn't. It's just as much of an unfair comparison as the one you're describing. :P

The programs on the site fit the rules defined on it, and the rules include the verification of the results: https://benchmarksgame.alioth.debian.org/why-measure-toy-ben... The OP doesn't even specify the rules for its own benchmark, as far as I understand doesn't verify the results? People here get NaNs? If the NaNs are produced as results, then the OP code is not measuring the speed of calculations at all but the s…

[deleted]

Re: What can Rust do for astrophysics?

#103
post #83
post #77

Earlier quoted context omitted.

The programs on the site fit the rules defined on it, and the rules include the verification of the results: https://benchmarksgame.alioth.debian.org/why-measure-toy-ben... The OP doesn't even specify the rules for its own benchmark, as far as I understand doesn't verify the results? People here get NaNs? If the NaNs are produced as results, then the OP code is not measuring the speed of calculations at all but the s…

> The programs on the site fit the rules defined on it, and the rules include the verification of the results I'm not sure what you're refuting? Verifying that the results match is a necessary but insufficient quality for ensuring comparability. If the algorithm could be the same in each language but isn't (e.g. quicksort vs. bogosort), then that's not a valid comparison if your objective is to determine the overhead…

> …repeated massive disclaimers that people should not take the performance results as a means of serious comparison.

Actually one small disclaimer --

"Non-motivation: We are profoundly uninterested in claims that these measurements, of a few tiny programs, somehow define the relative performance of programming languages."

There's much more about PL benchmarks in general.

Re: What can Rust do for astrophysics?

#104
post #30

I don't know the astrophysics domain at all but shouldn't there be more arguments for Go? * Safer than C * Almost as fast as C * Good concurrency support * High productivity due to simple abstractions and good tooling Is the downside of a GC language really relevant? Does astrophysics suffer from "stop the world interrupts" or is it just because of the performance? The Go GC is already really fast.

I looked at the Rust documentation's getting started page and it says: > If you’re using more than one word in your filename, use an underscore: hello_world.rs rather than helloworld.rs. Is the use of underscores a recommendation or a limitation?

It's a recommendation that you'll find everywhere in rust. By default camelCasing will output compiler warnings. It's my only complaint about the language so far, underscores aren't very typing friendly.

Re: What can Rust do for astrophysics?

#105

Earlier quoted context omitted.

>On OS X, so can't test if this actually makes a performance difference. The `time` command is part of base OS X.

But gcc is not.

In my reading of the comment it seemed to imply that the commenter already had both clang and gcc installed on their computer since they were talking about the amount of instructions produced by each. Perhaps I misunderstood?

Re: What can Rust do for astrophysics?

#106

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…

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?

#107

Earlier quoted context omitted.

We do not claim that Rust is so much performant than C, we just showed that Rust can be as fast as Fortran or C. And indeed, there must be something wrong with the C implementation. Pull requests with improvements are welcome: https://github.com/marblestation/benchmark-leapfrog

No, there is something wrong with the Rust version. I added println!("{:?}",x); to the end, and now I get 134 second runtime. Also the output is [[NaN, NaN, NaN], [NaN, NaN, NaN]], which is a bit worrying...

That is fixed now, conclusions are still valid :-) Thanks!

Re: What can Rust do for astrophysics?

#108
post #93
post #86

Earlier quoted context omitted.

From what I've seen, most of the Rust community agrees that using stable a perfectly fine choice; kibwen is offering context, not complaining.

https://news.ycombinator.com/item?id=13636724 Offering context? ;-)

That is a slightly different thing: stable is a perfectly good choice, but one can still debate the fairness or not of being compared to C-with-language-extensions i.e. not standard C (a joke which I think you missed, in one of kibwen's replies).

Re: What can Rust do for astrophysics?

#109

Earlier quoted context omitted.

But gcc is not.

In my reading of the comment it seemed to imply that the commenter already had both clang and gcc installed on their computer since they were talking about the amount of instructions produced by each. Perhaps I misunderstood?

I'm not sure, to be honest. I just assumed they were running GCC in a VM, but actually there was no real reason for me to assume that.

Re: What can Rust do for astrophysics?

#110

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…

The code has now been improved with all the suggestion friendly made by the Hacker news and Rust subreddit communities. Thanks!

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.)

Post reply on HN