Ancestors

Written by Giooschi@lemmy.world on 2024-10-27 at 15:26

A comparison of Rust's borrow checker to the one in C#

https://lemmy.world/post/21334791

=> More informations about this toot | More toots from Giooschi@lemmy.world

Written by solrize@lemmy.world on 2024-10-27 at 16:14

That is interesting and I didn’t know C# had anything like that. I saw another article recently saying at some point we were likely to see Rust get garbage collection.

=> More informations about this toot | More toots from solrize@lemmy.world

Toot

Written by GetOffMyLan@programming.dev on 2024-10-27 at 22:16

The reason is the vast majority of places use c# to avoid this stuff. So performance is often not the first priority

The complexity it adds takes away from the readability and maintainability. Which is often the priority.

But in a hot path where you need optimization these are a good send as previously you had to use raw pointers and completely side step all the safety of the language.

=> More informations about this toot | More toots from GetOffMyLan@programming.dev

Descendants

Written by solrize@lemmy.world on 2024-10-27 at 22:38

Yeah I had thought that C# was basically Microsoft’s version of Java, GC’d throughout. But it’s fine, I’m not particularly more excited by it now than I was before (i.e. unexcited). I’m not even excited by Rust, but maybe I’m missing something. I think it’s fine to use GC for most things, and program carefully in a non-allocating style when you have to, using verification tools as well.

A classic: …blogspot.com/…/brief-incomplete-and-mostly-wrong…

=> More informations about this toot | More toots from solrize@lemmy.world

Written by GetOffMyLan@programming.dev on 2024-10-27 at 23:57

It has always had structs. They are often used for interop but can be used to avoid allocations.

Both languages are really great in my opinion. But very different use cases generally.

=> More informations about this toot | More toots from GetOffMyLan@programming.dev

Written by nous@programming.dev on 2024-10-28 at 00:27

There are quite a few places where a GC is just not acceptable. Anything that requires precise timing for one. This includes kernel development, a lot of embedded systems, gaming, high frequency trading and even latency critical web servers. Though you are right that a lot of places a GC is fine to have. But IMO rust adds more than just fast and safe code without a GC - lots of people come to the language for those but stay for the rest of the features it has to offer.

IMO a big one is the enum support it has and how they can hold values. This opens up a lot of patterns that are just nice to use and one of the biggest things I miss when using other languages. Built with that are Options and Results which are amazing for representing missing values and errors (which is nicer than coding with exceptions IMO). And generally they whole type system leads you towards thinking about the state things can be in and accounting for those states which tends to make it easier to write software with fewer issues in production.

=> More informations about this toot | More toots from nous@programming.dev

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113381695309200317
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
279.476725 milliseconds
Gemini-to-HTML Time
1.494825 milliseconds

This content has been proxied by September (3851b).