Somebody who could use ATS some day. Maybe

:slight_smile:

https://capnproto.org/news/2015-03-02-security-advisory-and-integer-overflow-protection.html

Why don’t programming languages do this?

Anything that can be implemented in C++ templates can obviously be
implemented by the compiler directly. So, why have so many languages
settled for either modular arithmetic or slow arbitrary-precision
integers?

Languages could even do something which my templates cannot: allow me
to declare relations between variables. For example, I would like to
be able to declare an integer whose value is less than the size of
some array. Then I know that the integer is a safe index for the
array, without any run-time check.

Obviously, I’m not the first to think of this. “Dependent types” have
been researched for decades, but we have yet to see a practical
language supporting them. Apparently, something about them is
complicated, even though the rules look like they should be simple
enough from where I’m standing.

Some day, I would like to design a language that gets this right. But
for the moment, I remain focused on Sandstorm.io. Hopefully someone
will beat me to it. Hint hint.