News for hackers. Stuff that matters.
Re:Ruby Is Still a Diamond by joelbluminator on Thursday September 02, 2021 @10:17AM (#28392303)
What is the wow with Rust? Seriously asking.
Re:Ruby Is Still a Diamond by nobleach on Thursday September 02, 2021 @10:29AM (#28392500)
A few things come to mind. Rust has the potential to be fast... VERY fast. It also can be very safe. Pretty much everything in Rust utilizes the Result type (an Either Monad that causes Errors/Exceptions to become first-class citizens). It compiles to a single binary. Many of the packages in the ecosystem are very high-quality (Serde for example).

Even still, this doesn't mean anyone should drop what they're doing and migrate all their code to Rust! If you're a Ruby dev (especially if you do Rails) and you're making a living churning out apps with your good old friends like Devise, RSpec, etc. Rust is probably not the thing that'll really wow you. It _can_ do web, and do it REALLY well. But the experience is very different. (Actix/Rocket)

Re:Ruby Is Still a Diamond by zdragnar on Thursday September 02, 2021 @12:26PM (#28394053)
> Rust has the potential to be fast... VERY fast

I think this should be phrased differently. There is a minor bloom of zero-allocation web frameworks in go and java, and probably a few others, which blow their peers out of the water and are horribly not at all idiomatic usages of the languages.

They can be very fast, but the performance cliff for using idiomatic code is very significant.

Does idiomatic rust perform VERY fast? Can it be both very safe AND very performant? I think the answer to both of those is yes, but I honestly haven't used it enough to know.

Re:Ruby Is Still a Diamond by joelbluminator on Thursday September 02, 2021 @10:59AM (#28392896)
So Rust wants to be the new C? Like if someone was writing a new OS or code for an autonomous vehicle today is Rust a likely candidate?
Re:Ruby Is Still a Diamond by mping on Thursday September 02, 2021 @11:33AM (#28393342)
Rust wants to be the new C without C warts, using the compiler to ensure memory safety (up to a point), promoting immutability and having generics baked in.

I'm not a C programmer, but I think Rust can fit almost everywhere C can fit.

Re:Ruby Is Still a Diamond by unrealhoang on Thursday September 02, 2021 @10:40AM (#28392642)
The ability to use mutable data structure with worry-free mentality of immutable data structure (FP langs) is really new and special.
Re:Ruby Is Still a Diamond by joelbluminator on Thursday September 02, 2021 @10:57AM (#28392855)
So its a functional language with good performance? Or a systems functional language?
Re:Ruby Is Still a Diamond by closeparen on Thursday September 02, 2021 @01:13PM (#28394666)
Rather than designing around shared mutable state like a functional language, it gives you the tools to do it with greater confidence.
Re:Ruby Is Still a Diamond by azangru on Thursday September 02, 2021 @10:29AM (#28392510)
Yeah, I was wondering about that as well. Maybe the parent comment meant the practical implications, such as C-like speed with memory safety? As a language, Haskell has much more wow in it.
Re:Ruby Is Still a Diamond by joelbluminator on Thursday September 02, 2021 @10:58AM (#28392876)
Does it have C like speed though? Have no idea. I guess I just don't care enough about performance for Rust to be a thing for me.
Re:Ruby Is Still a Diamond by qsort on Thursday September 02, 2021 @11:24AM (#28393204)
I don't really use Rust so YMMV, but what's genuinely special about it is that it's a new take on a system-level language with very modern features (Error monad, borrow checker, pattern matching, functional-like semantics) that were previously exclusive domain of garbage collected languages.

Honestly I kind of cringe at the "do everything in rust" crowd, if you need to, say, write an API, you can just do that in Python or Ruby or Go, 99% of the times the performance penalty won't matter and Rust is just a very complicated tool for that job.

But it single-handedly reopened the discussion on high performance, safe(r) languages, and I believe that's a very good thing even though I don't use Rust day-to-day. Projects like Zig are in a sense following in the footsteps of Rust.

Re:Ruby Is Still a Diamond by Mikeb85 on Thursday September 02, 2021 @11:41AM (#28393457)
Systems programming language that's safer than C++, just as performant and has lots of functional goodies.