Re:Viper: a new programming language from Ethereum
by bluejekyll on Monday May 22, 2017 @09:43PM
(#14398218)
Rust has support for both of these, though the arithmetic overflows are effectively opt-in. Rust does define exactly what happens in overflow situations, and allows you to use different functions for controlling overflow options in others.
Re:Viper: a new programming language from Ethereum
by dbaupp on Tuesday May 23, 2017 @02:07AM
(#14399149)
It's a little glib, but Python 3 (and Ruby, I believe) both has checked array access and vacuously has overflow checking given integers can't overflow (by default).
Re:Viper: a new programming language from Ethereum
by masklinn on Tuesday May 23, 2017 @08:08AM
(#14400515)
Seems to be at runtime so, so almost every language for bounds checking.
Overflow checking is a bit more rare:
* Swift has it by default (error)
* So do Python, Ruby, Erlang (promotion to arbitrary precision)
* C# has an optional Checked Context though I don't know how common it is
* Rust has checked operations (opt-in, both error and saturating), will check (error) by default in debug mode, it can optionally check (error) in release mode
Re:Viper: a new programming language from Ethereum
by weavie on Tuesday May 23, 2017 @10:03AM
(#14401240)
Idris has compile time bounds checking.
It is a pretty special case though, you have to jump through a number of hoops using dependent types to get it.
Re:Viper: a new programming language from Ethereum
by masklinn on Tuesday May 23, 2017 @10:31AM
(#14401478)
> Idris has compile time bounds checking.
Indeed it does, but I'm guessing it doesn't come close to qualifying for "widely adopted language", my list is already stretching it.
Re:Viper: a new programming language from Ethereum
by haldean on Tuesday May 23, 2017 @12:27PM
(#14402599)
Both GCC and Clang have an extension to C that provide __builtin_xxx_overflow methods:
GCC: https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins...
clang: https://clang.llvm.org/docs/LanguageExtensions.html#checked-...
Re:Viper: a new programming language from Ethereum
by audunw on Tuesday May 23, 2017 @02:36AM
(#14399257)
Nim, but you can turn it off if you want
Re:Viper: a new programming language from Ethereum
by vikiomega9 on Tuesday May 23, 2017 @01:47AM
(#14399073)
Sorry, I'm confused, does bounds checking mean index out of bounds? If so, most modern languages?
Re:Viper: a new programming language from Ethereum
by Sean1708 on Tuesday May 23, 2017 @04:53AM
(#14399837)
I think the question was more about bounds checking on arithmetic, which most modern languages don't do by default.
Re:Viper: a new programming language from Ethereum
by myhf on Monday May 22, 2017 @11:56PM
(#14398696)
Fortran
I like that one. Anyone know any widely adopted languages that do this?