Microsoft's Rust guide for C#/.NET developers(microsoft.github.io)
microsoft.github.io
Microsoft's Rust guide for C#/.NET developers
https://microsoft.github.io/rust-for-dotnet-devs/latest/
10 comments
Having never touched rust before, this seems like a good launching point.
Curious though - why did Microsoft create this? Presumably they would be more interested in a C#/.NET guide for Rust developers.
Microsoft employs a number of people writing Rust code, with more on the way. I don’t have specific context as to why this guide was created, but it’s not like .NET languages are the only languages used at Microsoft.
[deleted]
f16 in Rust is equivalent to float in C#
f32 in Rust is equivalent to double in C#
f64 in Rust is equivalent to decimal in C#
correcting a typo on this page:
https://microsoft.github.io/rust-for-dotnet-devs/latest/lang...
f32 in Rust is equivalent to double in C#
f64 in Rust is equivalent to decimal in C#
correcting a typo on this page:
https://microsoft.github.io/rust-for-dotnet-devs/latest/lang...
Don't think that's quite right. `float` has 4 bytes, and `double` has 8. The `decimal` type has 16 bytes and does all it's arithmetic in base 10.
https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...
https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...
Are you quoting some old version? Because the page correctly states that Rust's f32 is C#'s float.
Where are you getting what you wrote?
Rust doesn't (March 2024) have f16. And the other correspondences you wrote are wrong.
There's a crate (several it seems) which realizes an f16 with arithmetic using u16, for example.
Rust doesn't (March 2024) have f16. And the other correspondences you wrote are wrong.
There's a crate (several it seems) which realizes an f16 with arithmetic using u16, for example.
That doesn't sound right.