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 Is it really a CPU bound Problem? From my personal experience most JS performance are caused by IO or initial bundle size.

Also most garbage collectors for JS are generational, which means they are fast for short-lived objects and the real problem are medium-duration objects, that fill up the old space. (I haven't measured it, so take with a grain of salt).

@Marthog Well all the code that I’m finding difficult/tiresome due to the above runs very often, or in large quantities.

Terrain generation and game logic in enormous bursts. Graphics and physics stuff 60–120 times per sec, audio synthesis 44000–96000 (aaagh) times per sec.

That’s a lot of CPU! And much of it suffers from any kind of GC hitches.