Hacker News new | ask | show | jobs
by HervalFreire 1171 days ago
In my opinion it's not pretty ok. It's actually superior to many other languages.

I think for web stuff though the borrowing and move semantics is a bit of an overkill. Usually you don't need to thread or handle state in these areas (frameworks and databases handle it for you) so a GC works better here. But everything outside of that is superior to something like ruby, python or go when it comes to safety.

2 comments

Matklad has hinted at this before, but it's funny how Rust is displacing ML dialects in domains where manual memory management is not at all necessary, simply because no ML has its tooling and deployment story straight.
I’m going to sound like a broken record, but F# is in the ML family and has wonderful tooling and the deployment story is getting dramatically better recently (it’s a little behind C# in its true native AoT compilation support, but it’s coming)
How do you build F#? I had a pretty bad time with FAKE/Paket the last time I tried it.
Honestly, the built in tooling has been good enough for me, in the .NET Core era (especially within the last few years). The MSFT CLI/IDE team has finally had the chance to fix some previous really annoying issues and limitations in the last few years, so the experience has gotten quite a bit smoother.

I know people that looove Paket, especially in the F# community, but I’ve been happy enough with things now to not feel like I need to invest the effort in adopting it.

I think if Rust could integrate a GC pointer elegantly into the ecosystem and put some of the knobs for running the GC the responsibility of user-space libs (ala pluggable GC), add in more optional type inference in places, and make it easy to refactor code to remove the GC, then it could become quite interesting for higher level glue code. As is, it’s not quite as good as TypeScript I think
There is a reference counting GC in rust. It's just not default and you have to be explicit about invoking it. It's similar to shared pointers in C++. See Arc.

For something like python the heap allocation or stack allocation is handled behind the scenes so the entire concept is abstracted away from you.

I meant a tracing GC like https://docs.rs/gc/latest/gc/.

Arc still requires you to reason about ownership as does this GC.

I think single threaded async w/ easy no copy message passing is more akin to what most people want when thinking about concurrency (eg Go channels) and actually happens to perform exceedingly well when it’s done up and down the stack (eg io_uring). In such a model you don’t even need to worry about ownership so much because you can’t Send anything except for things that need to be so there’s not a lot of value in many of the protections Rust tries to put in place.