←back to thread

239 points ivankra | 1 comments | | HN request time: 0.208s | source
Show context
cluckindan ◴[] No.45944902[source]
Memory safety is one of Rust’s biggest selling points. It’s a bit baffling that this engine would choose to implement unsafe garbage collection.
replies(5): >>45945042 #>>45945421 #>>45945492 #>>45945613 #>>45945847 #
jeroenhd ◴[] No.45945613[source]
Rust also has some nice language features. Even unsafe rust doesn't have the huge "undefined behaviour" surface that languages like C++ still contain.

If I were to write a toy JS runtime in Rust, I'd try to make it as safe as possible and deal with unsafe only when optimization starts to become necessary, but it's not like that's the only way to use Rust.

replies(1): >>45945781 #
1. LtdJorge ◴[] No.45945781[source]
That’s the philosophy. Use the less constrained (but still somewhat constrained and borrow checked) unsafe to wrap/build the low level stuff, and expose a safe public API. That way you limit the exposure of human errors in unsafe code to a few key parts that can be well understood and tested.