![](/static/253f0d9b/assets/icons/icon-96x96.png)
![](https://beehaw.org/pictrs/image/7a17afb3-71f4-4ef1-a5ce-d2975ba46c88.png)
There are techniques like abstract interpretation that can deduce lower and upper bounds that a value can take. I know there is an analysis in LLVM called ValueAnalysis that does that too - the compiler can use it to help dead code elimination (deducing that a given branch will never be taken because the value will never satisfy the condition so you can get rid of the branch).
But I think these techniques do not work in all use cases. Although you could theoretically invent some syntax to say “I would like this value to be in that range”, the compiler would not be able to tell in all cases whether it’s satisfied.
If you are interested in a language that has subrange checks at runtime, Ada language can do that. But it does come at a performance cost - if your program is compute bound it can be a problem
There are about 20x more e-bikes than electric cars. Of course its going to demand more oil.
The real question is what is best in terms of oil demand between electric cars and e-bikes