Why is TypeScript on NodeJS faster than Rust in computing the sum of the primes?

I wrote a benchmark that calculates the sum of the first 10000 primes and compared Rust to TypeScript. TypeScript on NodeJS is the fastest among Rust, Scala, and Java. Even though the programs intentionally use a functional style for testing primality aiming to show the advantages of Rust's zero-cost abstraction, NodeJS beats them all.

The answer can't be simple because V8 does a lot of transformations, but here's a major point:

Node's optimizing compiler dynamically adapts the types it uses (especially for array elements). It's able to use one word integers when they fit (and deoptimizes the function when it receives a non fitting value).

If I take your functions as they are, the Rust one takes 1.28ms to compute sum_prime(500) when Node takes only 1.04ms (after some warming). If I change the u64 to u32 in the Rust code, then it only takes 608µs.