Re:Rust-GPU: Making Rust a first-class language and ecosyste...
by azakai on Saturday October 24, 2020 @09:46AM
(#24879193)
Technically the unsafe escape hatches exist in those languages, but I think the point is that they are needed less. In Rust you need unsafe to implement some types of graphs, for example, which in GC languages are easy to do without any unsafety.
It's a tradeoff, of course: GC languages let you avoid unsafe code at the cost of doing GCs, which in some applications is an issue. Rust's stroke of genius is that it can avoid GCs while giving you almost all the safety of a GC language.
Overall I think it's safe (no pun intended) to say that Rust is significantly safer than C or C++, but slightly less safe than Java or C#. But of course both of those comparisons have lots of caveats and exceptions. And there are other factors than safety as well.
Re:Rust-GPU: Making Rust a first-class language and ecosyste...
by Const-me on Saturday October 24, 2020 @09:53AM
(#24879228)
> JNI
It's so complicated practically no one uses it.
> P/Invoke?
Can be disabled at VM level. Environments like asp.net classic default to partial trust, this ensures vast majority of third-party libraries aren't using p/invoke nor unsafe.
JNI, com.sun.misc.Unsafe, etc
> In C# the hatch exists but can be reliably shut.
P/Invoke?