Hacker News new | ask | show | jobs
by bsder 2114 days ago
Here's a starting difference between the two:

Rust code uses "unsafe" and doesn't apologize about not being pure. Rust tries to minimize "unsafe" and encapsulate it, but acknowledges that it must exist.

What's the Rust equivalent of "A monad is just a monoid in the category of endofunctors, what's the problem?" I can't really think of one.

Maybe there's something in lifetimes (which can be pretty messy). Maybe: "Quit using doubly linked lists or the borrow checker will beat you senseless."

In addition, there are lots of alternatives to Haskell that are almost as good. That isn't true of Rust. If you need systems programming, you have C, C++, maybe Ada. Rust is trying to drive a fairly difficult wedge into that area, but if it succeeds, the alternatives are scarce.

4 comments

I think you are onto something. I'm a small brained primate.

When I read "A monad is just a monoid in the category of endofunctors, what's the problem?" I feel that someone thinks they are being clever by being confusing and unhelpful.

But when I read "Quit using doubly linked lists or the borrow checker will beat you senseless." I feel like someones trying to be helpful.

Its confusing because that's the mathematical definition of a monad that you need to know category theory to fully understand. In haskell a monad is just a way to run some effects sequentially, it's actually really basic stuff that every programmer already has an intuition for.
What's the evidence Haskell has died? It seems to me that a fad has passed. The language is doing well. But the pretentious hipsters have moved on to their next obsession.

Rust? Well, talk about hip and groovy blah blah. About as great as C++. Full of complicated features, all pretty much focused on nitpicking, not expressivity. Could become hipster stuff for small projects. Enterprise? It's missing the point. There's no Machine Learning, no UI tools, no communications abstraction, no nothing. Just storage allocation without garbage collection.

Haskell will remain solid, but used by its aficionados. Rust will die as a niche language, and C/C++, sadly, will continue to dominate the low level coding, for better or for worse. Python and JavaScript will fill the UI centric space of Enterprise, with Python largely owning data centric stuff, and JS owning phone/tablet UX.

> Rust? Well, talk about hip and groovy blah blah. About as great as C++.

I hope Rust winds up as "great" as C++ in terms of popularity.

I don't need "web/crud enterprise" (there are a zillion languages for that) with it's infinite tower of abstractions, but I do need "embedded enterprise". And I'm really desperate for a language better than C for that.

> And I'm really desperate for a language better than C for that.

I got introduced at it with Turbo C++ 1.0 for MS-DOS in 1993, never cared for C ever since, other than when not given any other alternative to chose from.

"Full of complicated features, all pretty much focused on nitpicking, not expressivity."

What are a few of those features?

"A monad is just a monoid in the category of endofunctors, what's the problem?" is a joke about how the Haskell community often forgets not everyone has a PhD in category theory. It's not a real thing Haskell programmers tell people, in my experience.
I learned Haskell pre-Categorization, and modern Haskell tutorials make me sad. Haskell-without-mumbo-jumbo is a great expository language for learning about all sorts of sophisticated programming problem solving techniques, without having to deal with all the noise of Algol-derived languages.

I was taught “monads” as: “ok, you wanted mutability? Here is how we program imperatively in Haskell”. Whole thing just hung together.

> In addition, there are lots of alternatives to Haskell that are almost as good. That isn't true of Rust. If you need systems programming, you have C, C++, maybe Ada. Rust is trying to drive a fairly difficult wedge into that area, but if it succeeds, the alternatives are scarce.

In terms of purely technical ability to catch certain set of bugs at compile-time, Rust as a language is one-two generations behind ATS, that supports refinement types and theorem proving, whilst staying on the industrial side of the "(industrial) C <-> (academic) Coq" spectrum.

Haskell has unsafe methods in the standard library.

hackage.haskell.org/package/base-4.14.0.0/docs/System-IO-Unsafe.html

It also has a strict type-safety compilation flag that disallows these methods https://downloads.haskell.org/~ghc/latest/docs/html/users_gu...