Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>I don't see Haskell as uber language. If I want super correct code, speed and I'm okay with using a more complex language, then there is Rust – which is probably more correct than Haskell and faster, too.

But it doesn't even have Higher Kinded Types! What a disgrace. /s

I do wonder, what would OP, or any seasoned Haskell programmer, think about Rust. Would they consider it strange? Primitive? Too mainstream?



Rust is a great systems language.

When I write applications, I don't need a systems language, and Haskell is easier to use.

Also, Rust is a great imperative language, it's not as great as a functional language, and you can't reap the benefits of pure functional programming.


Rust doesn't really have a way to control for effects in functions. The type of the function doesn't define what the function can do. This I think is the biggest problem coming from haskell.


How does that work in Haskell, is it the pure/impure dichotomy regarding I/O that is encoded in the type signature? Because one could argue that Rusts ownership is a primitive version of that, but yielding most of the gains ("if it compiles, it works").


Kind of, but not really.

The combination of type classes (traits in Rust) and HKTs in Haskell mean that you can quite easily restrict a function to only be able to do a subset of what's possible in "the world".

A trivial example would be

   foo :: Logger m => Int -> m ()
where Logger is a type class (trait in Rust-speak) which implements the Monad type class (thus allowing 'imperative'-style programming), but also has a "log" method which allows the program to emit a string to the log.

The thing is that given the restrictions of parametric polymorphism that function 'foo' has to work for any Logger instance we give it, so it absolutely cannot do anything other than pure computation or invoking the "log" method. It cannot do any other side effects at all. So, it's not "pure", but it's also much more restricted than "impure".

That's a very powerful tool for modeling highly effectful systems.


Well there are more Haskell jobs than rust here, so I wouldn’t say more mainstream.

Syntax isn’t as nice as Haskell as well. A Haskell programmer fed up with purity would just move to Ocaml or F# tbh.


>Well there are more Haskell jobs than rust here, so I wouldn’t say more mainstream.

Only inside the echo bubble of Haskell.

Rust can be put to use in any place, without advertising it for it even -- and already powers widely used code across the world (and not just in Mozilla).

Haskell use mostly concerns a few financial institutions...


> Haskell use mostly concerns a few financial institutions

...who somehow have more resources to employ programmers than the organizations using Rust. Funny, that...


Do they? Or did they just had a head-start and aren't going anywhere booming further soon?

It's not like all the financial sector runs on Haskell or something -- the majority uses the usual culprits. The stories behind these organisations that I've read of is of some opinionated PM going in and making Haskell or OcamL and the like the officially supported language -- in Jane Street and Standard Chartered and the like. Which is the definition of being an outlier choice.

So, yeah, they are "more programmers" wanted for those 20+ and 30+ year languages, compared to a merely 3 year old language (Rust 1.0 was released in 2015).

But nowhere near the momentum.

Rust has been used already by Dropbox, Canonical, Cloudflare, Atlassian, Microsoft (Azure), Chef, Mozzila (of course), and tons of others in backend and client code. And that's in 3 years, and while the language is changing and core libs are still being built.

And it's silly to judge by job postings, as those places don't need to advertise for specific Rust roles (they can get regular systems programmers or use their own existing devs and have them do Rust). It's not a huge paradigm shift like with Haskell where you'll need people with that kind of training already. Besides, Rust is so new, there would be little point asking for Rust devs explicitly.


Don't forget Scala, it remains an interesting language. There's now a "native Scala" initiative...

Regardless, having the flexibility to program in the most appropriate style is nice.


Scala is interesting language, but I wish it had tighter focus. John De Goes describes pain points quite accurately in Scalapeno keynote: https://youtu.be/v8IQ-X2HkGE


Oh, but your first sentence is all-too-true at face value.

Rust is currently in the process of baking asynchronous I/O into the language, and their implementation cannot do this: http://blog.sigfpe.com/2008/12/mother-of-all-monads.html.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: