Re:Moving from TypeScript to Rust / WebAssembly
by nikki93 on Thursday July 09, 2020 @01:13PM
(#23782452)
Another consideration here is that you can use languages that offer control over data layout as a natural feature, which can matter a lot for good cache utilization etc. In many cases the data layout matters a lot for performance.
You can do this in JS too with TypedArray and whatnot but the key word here is 'natural.'
I've been working on a game engine as a side project with C++ and WASM -- and there are already many improvements over what I was getting with JS due to less GC, better data layout (the data layout thing is also esp. helpful for managing buffers that you drop into the GPU). I don't think it was about 'pure compute' as much as these things. C++ and Rust give you tools to manage deterministic resource utilization automatically which really helps.
A bonus is that the game runs with the same code on native desktop and mobile.
You can do this in JS too with TypedArray and whatnot but the key word here is 'natural.'
I've been working on a game engine as a side project with C++ and WASM -- and there are already many improvements over what I was getting with JS due to less GC, better data layout (the data layout thing is also esp. helpful for managing buffers that you drop into the GPU). I don't think it was about 'pure compute' as much as these things. C++ and Rust give you tools to manage deterministic resource utilization automatically which really helps.
A bonus is that the game runs with the same code on native desktop and mobile.