News for hackers. Stuff that matters.
Re:Rust for functional programmers by haberman on Sunday July 13, 2014 @06:09PM (#8028689)
It's funny, this article is dripping with attitude about how Rust will bring poor naive C programmers who are caught in the 70s into modern language design.

You could write just the same kind of article about how Rust will bring out-of-touch theorists into modern software engineering where you actually need a C-level of performance and predictability. And then show examples of all the same "for" loops with mutable variables that you're used to writing in C have direct analogs in Rust.

But both bits of snark would miss the point, which is: Rust is awesome precisely because it merges these two schools of thought into something that preserves the advantages of both.

Re:Rust for functional programmers by walrus on Sunday July 13, 2014 @06:40PM (#8028774)
Your comment about merging two schools of thought reminds me of two blog posts by the designer of Rust:

Part 1: http://graydon2.dreamwidth.org/3186.html (discussion: https://news.ycombinator.com/item?id=8026868)

Part 2: http://graydon2.dreamwidth.org/189377.html (discussion: https://news.ycombinator.com/item?id=8028255)

Re:Rust for functional programmers by haberman on Sunday July 13, 2014 @07:17PM (#8028866)
Great links, thanks! I'll have to sit down and read these in detail when I have some time.
Re:Rust for functional programmers by rybosome on Monday July 14, 2014 @03:16AM (#8029834)
I'm not so sure that I agree with your perception of the tone. The high-level takeaway I got from this article with respect to C was, "C's abstract machine is clearly the best way to think about performance sensitive programming, but the type system sucks". Is that not a fair statement?

I suppose there was an intro bit about Rust's lack of advertisement as a functional language (and perhaps that comes off as snooty), but from what I've seen of programmers outside of HN, this is a reasonable precaution. Most others I've talked to are either simultaneously ignorant and apathetic towards FP or actively distrustful. I literally had a friend at a major tech company tell me that he avoids FP because he does "real work", and he shouldn't have to bother with "idiots and their lambdas".

Then again, everyone likes to feel like the downtrodden victim. Dropping the pretense on both sides and trying to elucidate without proselytizing is the most effective strategy.

Re:Rust for functional programmers by haberman on Monday July 14, 2014 @11:40AM (#8031416)
I just re-read it and the tone didn't strike me in the same way as the first time. Mea culpa.
Re:Rust for functional programmers by pjmlp on Sunday July 13, 2014 @06:41PM (#8028778)
They're already did. It was called Lisp Machines, but the market favoured the "cheapest" text UNiX systems instead.
Re:Rust for functional programmers by coldtea on Monday July 14, 2014 @09:09AM (#8030695)
>You could write just the same kind of article about how Rust will bring out-of-touch theorists into modern software engineering where you actually need a C-level of performance and predictability. And then show examples of all the same "for" loops with mutable variables that you're used to writing in C have direct analogs in Rust.

It's not like immutable variables are some magic bullet...

Re:Rust for functional programmers by innguest on Monday July 14, 2014 @03:01PM (#8032567)
I'm not sure if you're joking, but when you have immutable variables they're pretty much like the mathematical variables that we've learned in school, and the benefits from that can be extremely huge (to the point that concurrency becomes easy). Whether that's considered a magic bullet is up to opinion, I guess.
Re:Rust for functional programmers by coldtea on Monday July 14, 2014 @03:20PM (#8032669)
>I'm not sure if you're joking, but when you have immutable variables they're pretty much like the mathematical variables that we've learned in school, and the benefits from that can be extremely huge

Yeah, I've read all the relevant stuff and seen my share of Hickeys presentations, Haskell folklore etc.

Still, I don't think it's some magic bullet. Maybe because IMHO, concurrency is just the latest fad IMHO. It's like: "OMG, we have so many cores and no more Moore's law, we HAVE to use them".

E.g on mobile apps. If concurrency (for speed) was important, people wouldn't use frameworks based on non-native scripting engines, adding 10 tons of overhead to their users resource constrained mobile phones.

While concurrency makes sense for server infrastructure and DSP stuff, for most of the problems programmers solve everyday (in web applications, in desktop applications, in enterprise applications, etc), it's really not that important. Not just because there are also processes, rpc, Node like async and similar strategies one can use (including APIs like Apple's GCD), but because it's not really about getting top speed, or most of the apps doesn't even come close to saturate 20% of a single core.

And there's always the graphic card for DSP and parallelism -- where it doesn't matter that much if your language has immutable variables or not, because you'll use CUDA etc for that.

Re:Rust for functional programmers by innguest on Tuesday July 15, 2014 @10:45AM (#8036699)
I agree with you. I do not think immutability is good just because of concurrency; in fact that is never my motivation for taking advantage of immutability. I do it because then I have fewer bugs than if I used mutable memory cells.
Re:Rust for functional programmers by Dewie on Sunday July 13, 2014 @07:00PM (#8028818)
> You could write just the same kind of article about how Rust will bring out-of-touch theorists into modern software engineering where you actually need a C-level of performance and predictability.

Well the 'Motivation' section is about how low-level languages are a better (closer) fit to the contemporary machine architectures than functional programming. That could be interpreted to be dripping with attitude about functional programmers being out-of-touch with how machines 'really work'. (Which also seems to miss the point that functional programming languages that care about performance tries to achieve that by transforming idiomatic functional code to efficient imperative code, not trying to leverage some kind of machine model that actually matches the semantics of functional programming languages.)

> And then show examples of all the same "for" loops with mutable variables that you're used to writing in C have direct analogs in Rust.

Iterators seem to be more idiomatic in Rust than the loop alternatives.