Add an `Integer` primitive.
It's sometimes convenient to specify something as an integer, rather than supplying a possible range. This implementation is probably not robust enough and should be backed by bignum, but I'm treating it as an experiment.
Generalizing, it would be nice to add a primitive String type.
I understand the appeal in having a minimal language with a small surface area, however builtins are rather convenient.
Test plan:
npm test- Run this contract: https://gist.github.com/joelburget/7b9693bb4abde38a046ad2ab3e758e62
By the way, this is more of an RFC than a serious pull request. Curious whether there's interest in something like this in the language.
The problem with having unconstrained integers is that you can't exhaustively search through them in the check phase.
I'd be ok with an Integer as shorthand for a (signed/unsigned?) number that's at least 32 bits large. That's pretty much what your PR implements, so that's cool. I'm trying to keep it possible for a more efficient compiler to execute models without storing model state on the heap, so I'd like to avoid bignum if at all possible. For the same reason, Vector
Strings feel like a separate discussion. I've thought about having string literals for print statements before (or better yet, format strings). Do you have a use case for manipulating strings at runtime?