polygolf-lang / polygolf

Polyglot autogolfer for https://code.golf
https://polygolf-lang.github.io
MIT License
19 stars 7 forks source link

Int type shorthands #133

Open MeWhenI opened 1 year ago

MeWhenI commented 1 year ago

Adding a few shorthands for common int types could make writing polygolf code a bit nicer. I would suggest

$a:byte <-> $a:0..256
$a:u32  <->  $a:0..4294967295
$a:i32  <-> $a:-2147483648..-2147483647
$a:u64  <->$a:0..18446744073709551615
$a:i64  <-> $a:-9223372036854775808..9223372036854775807
$a:uBig <-> $a:0..oo
$a:iBig <-> $a:-oo..oo

A potential downside of this is it may create confusion about what these types actually mean, ie people assuming they can use the overflow behavior of an "i64"

MichalMarsalek commented 1 year ago

I don't like this since there's almost always a narrower type the user could use.