The Coin Change problem in ATS, Rust, and Zig - a comparison
timmyjose.github.io/docs/2020-07-31-coin-chan...Posted Sep 5, 2020, 2:53 AM UTC
144
Posted Sep 5, 2020, 2:53 AM UTC
I don't really know ATS, but it being the slowest is not the result I expected...
A quick scan of the example shows a number of differences to the Rust version. The Rust version uses an array and array indexing. The ATS version is using a tuple and the indexing is done with a function with an 'if' statement to compute the item of the tuple to select. This will be slower.
[deleted]
An ATS version that doesn't use a tuple:
https://github.com/dambaev/coin_change/blob/master/ats/src/TEST/test2.dats
gives me
against yours
and against original version: