If you want to save on memory then you need to drop down to callbacks, promise chains, or async-await sugar that is a compiler transform to a state machine.
But if you do that, then you will write a blog complaining about the boilerplate!
I think Zig had an ability to kind of give you the best of both worlds. A zig expert would need to correct me on this.
I personally use TypeScript since it has unions and structural typing with native JSON support but really anything can work.