Compared with Rust, ATS provides better type safety at the boundaries; foreign functions and data structures can be used in a first-class way without sacrificing type safety.
You may have seen the Some Were Meant for C polemic; I do not agree with it completely but I encourage you to read it if you have not. Here, I give some comments on ATS and Rust in light of it.
ATS is known for its sophisticated type system, but it also has a template system that has been the focus of recent work. Rather than going into technical details or comparing templates to other forms of generic programming, I wanted to give an example.
Suppose we want to count the number of lines in a file. Rust has a crate that would seem to help us, namely, bytecount.
Here I would like to present benchmarks associated with my past
post comparing different methods of
summing the first \( n \) numbers. In each case, we benchmarked sum(200)
,
that is, \( \sum_{i=1}^{200} i \).