3 ms·
> that’s checked in Rust too In safe Rust. Safe C# is the same, it doesn’t even have raw pointers in the language unless compiling with /unsafe, and writing co
by Const-me 6y ago
> that’s checked in Rust too
In safe Rust. Safe C# is the same, it doesn’t even have raw pointers in the language unless compiling with /unsafe, and writing code in unsafe blocks.
> More like “write to this register” than “here’s a complex data structure.”
I sometimes write C++ DLLs precisely to implement these complex data structures. Modern CPUs have progressively worse proportion of RAM latency / compute speed. This means you need full control over memory layout of data on the performance critical paths of code, or it will be slow.
Also, many external APIs have incredibly complex unsafe structures. Here’s a piece of Linux kernel API I have recently consumed in C#: https://www.kernel.org/doc/html/v4.20/media/uapi/v4l/v4l2.html https://www.kernel.org/doc/html/v4.20/media/uapi/v4l/v4l2.ht... Way more complicated than writing registers.
- steveklabnik 6y agoThey’re checked in unsafe too. You only skip those checks if you use a specific “do this index with no checks” function. Unsafe does not change the semantics of code, only gives you more options. Yes, and many people write that kind of code in Rust too, and use tools to help them debug it. I’m just saying that it’s not an issue for the kinds of code I write, so I can’t personally recommend tooling. I know "use GDB" isn't a great response to a Windows user, even if it is what I end up personally doing. Funny enough, I just booted up VS, and it's not perfect, but https://imgur.com/a/kHvPIEr https://imgur.com/a/kHvPIEr (It's true that I can't get the performance tools working though, but given I've used VS for all of 20 minutes... I'm also very interested to see if support happens native-ly, given how much interest there is for Rust inside of Microsoft right now.)
- jfkebwjsbx 6y agoHowever you put it, tooling support is way, way better for C and C++ for obvious reasons. Other critical bits for commercial development in many industries (certs, standards, third-party support, official bindings...) are also completely lacking. That is not something against Rust, it is just what happens until things get popular enough.
- steveklabnik 6y agoAbsolutely. All I’m saying is that it’s non-zero, not that it’s equivalent.