I'm not so sure about implementation of Rust's semantics in JS. If I want exact Rust semantics, I can use WASM.
I'm not so sure about implementation of Rust's semantics in JS. If I want exact Rust semantics, I can use WASM.
From recent experiences in profiling and optimizing different backend apps, I'm confident that imposing some constraints on JS we can get noteworthy improvements on the performance front better or equal to golang. Here's a subset of the constraints I'm looking at:
- Avoid out-of-bound reads in arrays and monomorphization.
- Manage memory allocations. (pools)
- Implementing inlining, also done by V8 and JSCore.
- Keep variables close to usage context.
- Being picky about standard js operations.
- Using 'new Array(n)' for creating longer arrays, and '.push()' for smaller ones but if frequently calling methods on an array, avoid preallocating.
- Avoid arrays with holes, prefer using arrays with numbers.
- Use cached prototypes for object creation.
- Avoid working with strings as much as possible, use typed array when possible.
- Partial evaluation.
ps: Thank you for all your work in the Rust ecosystem, I've used a lot of your crates over the last year.