TWiR quote of the week

I like that quote, though I disagree with your conclusion. Functional programming is not "completely bonkers", as you say. In certain settings it can work very well.

That said, Rust gets us perhaps 90% of the benefits of pure functional programming with 10% of the cost in terms of incidential complexity.

5 Likes

Of course I'm being somewhat extreme and provocative with my "completely bonkers". However I think it's that 90% incidental complexity you refer to that validates it as a fair description of pure functional programming. And causes my wondering as to why anyone would ever want to do that.

Do you have an example of a case where Functional programming works very well? Something that fits on a page and is understandable by mortals?

No doubt I'm totally missing a point but as far as I can tell it is impossible to compute anything of interest with pure functional programming and immutable data.

My naive mind thinks of it like this:

I can count my sheep in the field by carving successive notches on a stick. Each notch is there forever. If I want to count a new sheep I need to carve a new notch. Anyone with only a partial view of the stick may only see the old notches, unchanged. Or they can see the notches on my old discarded sticks. That is immutable data.

Soon, my farm is so big, I have so many sheep, I run out of room on my stick for new notches, I run out of sticks to use. So I invent a number system that compresses huge counts into little space. I can't use my number system on a stick as I can't remove notches. So I invent the abacus. I now have mutable data.

Some time later the tax man comes by. He asks to see my tally sticks from last year. Oops, now I have a problem! I need records, databases, immutable data structures, extra book keeping work. Incidental complexity.

What am I missing in my shepherds tale?

3 Likes

Heard from a colleague, quoting a mailing list discussion:

After a few weeks of writing Rust and feeling like I was near tears of frustration, I returned to Python. But when I did start writing in Python again, I felt like a newly fit and healthy guy relapsing into old habits in an ugly way (e.g. eating a whole pizza each night and chasing it with a six pack and a bottle of liquor while watching star trek voyager on binge mode). The relapse felt both good and horrible at the same time.

9 Likes

If you show up and act like you're in, you're in.

  • Lokathor, explaining how to join the Gamedev Working Group
10 Likes

WikiPedia:
"In computer science, functional programming is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data."

I dunno, I always thought of functional programming as a deranged COW disorder... :wink:

Maybe block chain? I was going to eventually ask.

It would work in my communications protocols certainly. If you are just asking would it work. Any places where you WANT to enforce this strict constraint.

How is it for mathematics I wonder?

Isn't this someway equivalent to asking "Is Map useful?"

on reddit
steveklabnik1 : These things take time, and there’s no promises made about the exact dates.
tomas_skare :There are no promises on rust, only futures...

12 Likes

For the people discussing the merits of functional programming in this quote-voting topic, discourse has a wonderful function: "reply as new topic".
It hides under the post date in the top right ("3h") -> "+ new topic".

Let's try to keep this thread on-topic, and follow-up on the (admittedly cool) tangents elsewhere.

To quote from our very own forum faq:

Keep It Tidy
Make the effort to put things in the right place, so that we can spend more time discussing and less cleaning up. So:

...
• Don’t divert a topic by changing it midstream.

https://users.rust-lang.org/faq#keep-tidy

6 Likes

It's amazing what you can make a computer hallucinate these days.

DannoHung from Reddit commenting on the Texture Synthesis crate from Embark Studios.

Maybe a stretch for QotW as the comment absent context is indistinguishable from non-Rust libraries, but I felt this could bring a more attention to a neat Rust project in an entertaining way.

6 Likes

The Rust compiler is basically 30 years of trying to figure out how to teach a computer how to see the things we worry about as C developers.

James Munns (@bitshiftmask) on Twitter

18 Likes

Sometimes a pun arises in the middle of description...

7 Likes

C is about simplicity at any cost. Rust is about simplicity at a pick-your-own-price.

eo5g on r/rust

5 Likes

I don’t like Rust being pigeon holed as a “safer C++”—it’s so much more than that.
t’s been stated more often lately. It overlooks the fact that Rust has actively opened the door to systems programming to people coming from langs like Javascript, where C and C++ never did.

12 Likes

From Is there a simple way to overload functions? - #24 by clintonmead

6 Likes

"Rust compilation is so slow that I can fix the bugs while it still compiles the crates"

24 Likes

Did you say that right now or is it a quote from somewhere?

1 Like

Yes, I said that but you can quote me.

2 Likes

-- Rustafarian three days ago in this thread

19 Likes

-- OptimisticPeach

9 Likes

Another self-nomination:

12 Likes