Live data from Hacker News

Monads and GATs in Nightly Rust

fpcomplete.com

101–110 of 176 posts

Re: Monads and GATs in Nightly Rust

#101
post #97

I saw Scala taken over and destroyed by the FP fanatics who want to turn every language into Haskell. I hope they don't do the same to Rust. Just use Haskell and leave the rest of us alone! It sounds silly but its true.. as you increase the complexity of the language, the hardcore users making the libraries adopt those features, which means users have to adopt those features as well. Pretty soon everyone is talking a…

FP has little to do with real-world programming and not even much to do with computer science. Look through Knuth, Dijkstra, Turing, etc. and find an example of FP--you can't. It's the mentally challenged stepchild of CS for programmers who have developed physics envy (or perhaps more appropriately, string theory envy).

Turing had about as much to do with real world programming as Alonzo Church so I think that’s equal if you really want to keep score. But there are other famous names in the history of computer science who did support functional programming, eg McCarthy or Backus. And there are “real world” programmers like John Carmack who advocate applying FP techniques to their programs.

But this is a stupid thing to argue about and not relevant to this thread.

Re: Monads and GATs in Nightly Rust

#102
post #97

Earlier quoted context omitted.

FP has little to do with real-world programming and not even much to do with computer science. Look through Knuth, Dijkstra, Turing, etc. and find an example of FP--you can't. It's the mentally challenged stepchild of CS for programmers who have developed physics envy (or perhaps more appropriately, string theory envy).

I would say that it has a lot to do with CS. Basically there's two equivalent ways to look at computing: as Turing machines or lambda calculus. The first is far more popular as early machines and even our current day hardware is close to this. As machines have become more powerful we can do more useful work using formulation based on function composition. If anything this is a trend. What we don't yet have is common…

no chip manufacturers sell a chip that runs lambda calculus. until then it's just mental masturbation.

Re: Monads and GATs in Nightly Rust

#103

I saw Scala taken over and destroyed by the FP fanatics who want to turn every language into Haskell. I hope they don't do the same to Rust. Just use Haskell and leave the rest of us alone! It sounds silly but its true.. as you increase the complexity of the language, the hardcore users making the libraries adopt those features, which means users have to adopt those features as well. Pretty soon everyone is talking a…

A comment I made in https://news.ycombinator.com/item?id=25327337 comes to mind.

"Any method of abstraction that you have internalized becomes conceptually free to you." (So for the sake of others, choose wisely which you will expect maintenance programmers to have internalized!)

If you've internalized all of the FP ideas, then adding them to a new environment seems useful and seems to cost nothing. It is hard to keep track of how much burden you are adding for people just learning the environment because, for you, it is free.

Re: Monads and GATs in Nightly Rust

#104

Earlier quoted context omitted.

> If the people who are passionate about a language are the ones who pursue its advanced features (and therefore somehow force them on the rest of the world), who then is left to "actually build shit"? Some people are passionate about the language itself, and programming language theory in general. Others are passionate about solving whatever particular problem their project solves. A simple thought experiment - thin…

>A simple thought experiment - think about the most widely used libraries and tools across the whole developer ecosystem. How many are built in Haskell? I count maybe one, Pandoc. Purescript and Elm are two more. If you don't count languages, then Xmonad and Darcs are another two. Both Github and Facebook's efforts in mass source-code searching are written in Haskell (though Facebook's is not really released to the w…

I don't know if this is still widely embraced, but Haskell's motto has traditionally been "Avoid success at all costs." It was meant to be a language that embraced PLT and experimented with cutting-edge techniques, so it's not terribly surprising that it's produced more PLT experiments and hasn't produced as much consumer software as, say, Go, which had essentially the opposite philosophy.

Re: Monads and GATs in Nightly Rust

#105
post #97

I saw Scala taken over and destroyed by the FP fanatics who want to turn every language into Haskell. I hope they don't do the same to Rust. Just use Haskell and leave the rest of us alone! It sounds silly but its true.. as you increase the complexity of the language, the hardcore users making the libraries adopt those features, which means users have to adopt those features as well. Pretty soon everyone is talking a…

FP has little to do with real-world programming and not even much to do with computer science. Look through Knuth, Dijkstra, Turing, etc. and find an example of FP--you can't. It's the mentally challenged stepchild of CS for programmers who have developed physics envy (or perhaps more appropriately, string theory envy).

I'm writing this on a system with an FP package manager and anyone programming in any popular language these days will be exposed to a heavy dose of FP constructs and concepts, and as far as Knuth is concerned McIllroy famously burried his grand imperative efforts with a one line functional program 36 years ago. Having said that, your unkind remarks about academic programing language researchers do not strike me as unfounded in all cases.

Re: Monads and GATs in Nightly Rust

#106
post #97

Earlier quoted context omitted.

FP has little to do with real-world programming and not even much to do with computer science. Look through Knuth, Dijkstra, Turing, etc. and find an example of FP--you can't. It's the mentally challenged stepchild of CS for programmers who have developed physics envy (or perhaps more appropriately, string theory envy).

> not even much to do with computer science That is very debatable. Lambda calculus is a BFD in the subfield of programming languages, which is the topic at hand.

> Lambda calculus is a BFD in the subfield of programming languages

This is a good example of abusing the vocabulary of mathematics as is common in the FP world. A programming language is not an object in abstract algebra. You can't add, subtract, or factorize a programming language. It's just software.

Re: Monads and GATs in Nightly Rust

#107
post #64

Even though I see that these language capabilities remove restrictions I hope that HKTs and with them Functors, Monads, etc. will never make it into Rust. The thing I like most about Rust is that it is still a practical language where I can still solve my problems in different ways and always know what will happen. I also care about the "how" and not only about the "what". Everything being F[_]ed is what I do not nee…

Functors and Monads already exist in Rust, you just can't talk about them in the trait system. Option, Result, and Future are all both Functors (map) and Monads (and_then). You've probably used them without even knowing, because we didn't give it some weird, unlearnable category theory name.

If someone were to create an explicit trait for them and RFC it, they'd probably name it something like Map and Then rather than Functor and Monad.

Re: Monads and GATs in Nightly Rust

#108

I saw Scala taken over and destroyed by the FP fanatics who want to turn every language into Haskell. I hope they don't do the same to Rust. Just use Haskell and leave the rest of us alone! It sounds silly but its true.. as you increase the complexity of the language, the hardcore users making the libraries adopt those features, which means users have to adopt those features as well. Pretty soon everyone is talking a…

> I saw Scala taken over and destroyed by the FP fanatics

I suspect that the above reflects a very personal experience rather than something general. I have been using Scala for 10 years and never used monad transformers. I find Scala code usually easy to write and to read. At this point I wouldn't trade it for any other language.

From where I stand, Scala was neither "taken over", nor "destroyed by FP fanatics". It is not Haskell, and the upcoming Scala 3 is not going in the direction of being more like Haskell. Scala has always been about supporting both object-orientation and functional programming. It's still the case with Scala 3, and it's getting better and better.

Re: Monads and GATs in Nightly Rust

#109

Earlier quoted context omitted.

The F in FP definitely hugely benefits from GC. Closures in Rust don't compare to Haskell. Combine that with GHC's optimizer and it's no contest which language to choose if both ergonomics and performance of code written largely as lambdas is your priority.

With linear types you could get rid of the GC, probably.

Hm ATS is prior art re: linear types and closures. It's definitely not the same.

That said, -XLinearTypes in GHC 9.x will open up a world of memory management capabilities in library-space for Haskell. Very exciting stuff! If you push the heavy stuff off-heap, then the GC just becomes a slightly fancier arena allocator.

Re: Monads and GATs in Nightly Rust

#110
post #103

I saw Scala taken over and destroyed by the FP fanatics who want to turn every language into Haskell. I hope they don't do the same to Rust. Just use Haskell and leave the rest of us alone! It sounds silly but its true.. as you increase the complexity of the language, the hardcore users making the libraries adopt those features, which means users have to adopt those features as well. Pretty soon everyone is talking a…

A comment I made in https://news.ycombinator.com/item?id=25327337 comes to mind. "Any method of abstraction that you have internalized becomes conceptually free to you." (So for the sake of others, choose wisely which you will expect maintenance programmers to have internalized!) If you've internalized all of the FP ideas, then adding them to a new environment seems useful and seems to cost nothing. It is hard to kee…

It's worse than that. Getting used to something doesn't make it free. It simply makes you unaware of the cost you're constantly paying. Having convoluted abstractions really screws up your thinking. I've seen this first hand with class-oriented programming, Enterprise Java and design patterns. People were 100% convinced they are writing awesome code, when in fact they were wasting time and creating dysfunctional monstrosities. The same illness seem to be re-emerging in FP space thanks to the obsession with types.
Post reply on HN