Live data from Hacker News

Yehuda Katz and Steve Klabnik Are Joining the Rust Core Team

blog.rust-lang.org

61–70 of 135 posts

Re: Yehuda Katz and Steve Klabnik Are Joining the Rust Core Team

#61
post #47

Earlier quoted context omitted.

What would be the reason to learn Rust over Haskell? They seem to be about in the same speed ballpark: http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan... Is that not representative, or is the idea that Rust speeds the learning curve with its similarity to Ruby?

(1) Even in that benchmark, Haskell is over twice as slow as Rust on average. (2) The Haskell code is nowhere near idiomatic. It is still useful to know that Haskell can be quite fast if necessary, but it likely does not reflect what your actual experience using Haskell would be.

> (2) The Haskell code is nowhere near idiomatic

This isn't meant as a personal attack firstly. Secondly, I've heard this said more than a few times lately and am generally curious:

Do you know which Haskell examples are idiomatic, which aren't, and why?

I feel like in the case of some it's just parroting someone elses argument.

Re: Yehuda Katz and Steve Klabnik Are Joining the Rust Core Team

#63
post #6

Congratulations Yehuda and Steve! We've been using Rust in production for awhile now, specifically because of its combo of native speed and memory safety[1]. This bending of traditional tradeoffs has let us implement features that would have been otherwise impossible. Interfacing with Ruby via its C APIs, we are able to do some pretty crazy stuff, like sample memory allocations in production with imperceptible overhe…

> This bending of traditional tradeoffs has let us implement features that would have been otherwise impossible.

Could you talk more about what sort of features these are?

Re: Yehuda Katz and Steve Klabnik Are Joining the Rust Core Team

#64

Earlier quoted context omitted.

(1) Even in that benchmark, Haskell is over twice as slow as Rust on average. (2) The Haskell code is nowhere near idiomatic. It is still useful to know that Haskell can be quite fast if necessary, but it likely does not reflect what your actual experience using Haskell would be.

> (2) The Haskell code is nowhere near idiomatic This isn't meant as a personal attack firstly. Secondly, I've heard this said more than a few times lately and am generally curious: Do you know which Haskell examples are idiomatic, which aren't, and why? I feel like in the case of some it's just parroting someone elses argument.

A glance at the source quickly reveals an unsafe implementation.

Re: Yehuda Katz and Steve Klabnik Are Joining the Rust Core Team

#65
post #51

Congratulations! The two of you easily became two of my biggest role models after I was introduced to web development; its been a pleasure to follow your general trajectories. Thanks for showing us what is possible when you're willing to actually do something!

<3

Re: Yehuda Katz and Steve Klabnik Are Joining the Rust Core Team

#66
post #4

Thus continues Yehuda's quest to join every cool core team on the Internet. :) See also: Rails, Bundler, Ember.js, jQuery, W3C TAG, TC39.

Yeah, I wonder how he manages to juggle all of that. What's your secret wycats? (I'm not really expecting there to be a single secret).

I watched his talk Endurance(https://www.youtube.com/watch?v=yYihop9gHj4) to be pretty amazing and inspiring. He talked about some really important points which makes me think and reflect on self. A must watch.

Re: Yehuda Katz and Steve Klabnik Are Joining the Rust Core Team

#67
post #64

Earlier quoted context omitted.

> (2) The Haskell code is nowhere near idiomatic This isn't meant as a personal attack firstly. Secondly, I've heard this said more than a few times lately and am generally curious: Do you know which Haskell examples are idiomatic, which aren't, and why? I feel like in the case of some it's just parroting someone elses argument.

A glance at the source quickly reveals an unsafe implementation.

I didn't see an import for unsafe or foreign in:

fannkuch-redux pidigits binary-trees

Re: Yehuda Katz and Steve Klabnik Are Joining the Rust Core Team

#68

Earlier quoted context omitted.

(1) Even in that benchmark, Haskell is over twice as slow as Rust on average. (2) The Haskell code is nowhere near idiomatic. It is still useful to know that Haskell can be quite fast if necessary, but it likely does not reflect what your actual experience using Haskell would be.

> (2) The Haskell code is nowhere near idiomatic This isn't meant as a personal attack firstly. Secondly, I've heard this said more than a few times lately and am generally curious: Do you know which Haskell examples are idiomatic, which aren't, and why? I feel like in the case of some it's just parroting someone elses argument.

Just in the first two examples on that page, you'll find allocaArray, mallocByteString, writeAlu, unsafeUseAsCString, unsafeIndex, withForeignPtr, unsafeDrop, and more. You really don't have to know Haskell very well (and I'm not claiming to be an expert by any stretch) to understand that this is far from idiomatic in a lazily evaluated, pure functional language. No parroting required.

Re: Yehuda Katz and Steve Klabnik Are Joining the Rust Core Team

#69
post #64

Earlier quoted context omitted.

A glance at the source quickly reveals an unsafe implementation.

I didn't see an import for unsafe or foreign in: fannkuch-redux pidigits binary-trees

fannkuch-redux heavily utilizes unsafe operations on a mutable vector.

binary-trees uses artificial strictness for the sake of the benchmark.

Nine of the ten Haskell implementations are demonstrations of writing C in Haskell (without reaching C's performance).

Re: Yehuda Katz and Steve Klabnik Are Joining the Rust Core Team

#70

Earlier quoted context omitted.

(1) Even in that benchmark, Haskell is over twice as slow as Rust on average. (2) The Haskell code is nowhere near idiomatic. It is still useful to know that Haskell can be quite fast if necessary, but it likely does not reflect what your actual experience using Haskell would be.

> (2) The Haskell code is nowhere near idiomatic This isn't meant as a personal attack firstly. Secondly, I've heard this said more than a few times lately and am generally curious: Do you know which Haskell examples are idiomatic, which aren't, and why? I feel like in the case of some it's just parroting someone elses argument.

>I feel like in the case of some it's just parroting someone elses argument.

It usually is. The reality is that like most memes like this, there's a grain of truth at the center, but most of the people repeating it don't know where the truth ends and the exaggeration begins.

Regex-dna is using low level ByteString operations to squeeze out a bit of extra performance. This makes it quite a bit longer and would rarely be done in practice since the gain is small.

Fasta again does some low level ByteString operations, but not nearly as significant as regex-dna. Not that bad.

Others like fannkuch-redux are just using "unsafe" vector functions. All that is doing is leaving out bounds checks. That makes an miniscule difference in performance most of the time, but the way the shootout works there's only incentive to completely optimize for speed, so you get 1% optimizations you wouldn't normally see. I'd hardly call it unidiomatic though, you just normally use "read" instead of "unsafeRead", etc. In some cases I would say the unsafe calls are idiomatic. If you are going to be doing an operation repeatedly in a loop, doing the bounds checking once before looping and using the non-bounds checked calls in the loop is pretty standard.

Pidigits is normal haskell (although you could argue the lack of spacing isn't idiomatic, but that hardly matters).

I stopped there since the rest are getting enough slower than rust, but looking them over there's still nothing outrageous, just more low level ByteString usage. Overall none of them are that far from idiomatic, none of them do anything particularly crazy, and I think the speed gains from doing most of the optimizations they are doing are fairly small. I find it particularly odd that people act like the ability to write lower level code that is faster is a problem with haskell. Especially given that the "low level" haskell versions are often still shorter and no harder to read than the "idiomatic" rust versions.

Post reply on HN