Outperforming Rust with Functional Programming
blog.vmchale.com
blog.vmchale.com
There's no heap allocation in the Rust nor C code.
I haven't looked into the codegen to see what's different here.
tl;dr: the C and Rust versions had signed integers rather than unsigned like the ATS version, and if you make that change they end up more similar.