My problems with JS:

1. Allocating objects or closures results in death by garbage collection.
2. So I spend tons of effort managing indices, juggling reused objects, and passing them around awkwardly because functions can only return 1 value.
3. As for the objects, only TypedArrays/ArrayBuffers are fast, but they too require juggling due to having fixed maximum lengths.

If I started using Rust or something instead, would it ease these specific problems? Or is this just my life now?

@jonikorpi those specific problems, yes - massive bottleneck for JS performance

new problems: understand & working with Rust's ownership and borrowing

learning new language: something like Odin/Zig allows low level alloc/dealloc, pointers etc

halfway option is to offload any compute heavy tasks to Wasm with shared array buffers. Zig compiles super easy to Wasm. Workers allow concurrency.