"in a statically typed language the language would force.. coercion"
But R just did an implicit coercion, right there. You gave it ints, it gave you back 1e12. I don't know R well enough to understand what the int() call does, but there's no reason why a dynamic language can't perform implicit coercion. Python does:
>>> type(1000000)
<type 'int'>
[define sumXX]
>>> sumXX([1000000,2000000,3000000,4000000,5000000])
55000000000000L # <--- type long
I could wrap the elements of the list in int() calls but that would change nothing.The whole point of dynamic languages is that you don't have to think about the types of your numbers. They're just numbers. If you have a use case that requires "4-byte integers, goddammit!" (and there are many valid ones), why yes, you should use a static language and think about overflow. If you don't want to think about overflow, the languages that go to the greatest lengths to shield you from it (lisps) are all dynamically typed.