2 ms·
> If Javascript was transpiled to Rust Seems challenging. JavaScript code does not come with lifetime information that the Rust compiler expects to have to get
by jraph 4y ago
> If Javascript was transpiled to Rust
Seems challenging. JavaScript code does not come with lifetime information that the Rust compiler expects to have to get rid of stuff that's not used anymore, while JS has a garbage collector to do this.
There's also no borrowing information encoded in JavaScript code. Rust expects the developers to provide this information in their code so it knows who and where what can modify what.