Nick Smith
06/01/2020, 2:09 AMNick Smith
06/01/2020, 2:11 AMEdward de Jong / Beads Project
06/01/2020, 3:41 AMNick Smith
06/01/2020, 7:21 AMRobert Butler
06/01/2020, 5:11 PMDoug Moen
06/01/2020, 7:53 PMDoug Moen
06/01/2020, 7:54 PMNick Smith
06/02/2020, 7:09 AMNick Smith
06/02/2020, 7:11 AMNick Smith
06/02/2020, 7:14 AMRobert Butler
06/02/2020, 7:56 AMRobert Butler
06/02/2020, 7:59 AMRobert Butler
06/02/2020, 8:02 AMNick Smith
06/03/2020, 1:02 PMNick Smith
06/03/2020, 1:03 PMDoug Moen
06/03/2020, 4:09 PMand
, or
, xor
, and not
are just those boolean operations extended to work on boolean arrays. For hash functions, I also needed operations to convert between numbers and bit strings, and I needed a bitwise version of integer addition that wraps around (ie, it has ALU semantics). Unlike C, Python or Javascript, my "bit add" operation, which only works on bit strings, is distinct from the "+" operator that only works on numbers, and they have different semantics.Robert Butler
06/04/2020, 1:22 AMNick Smith
06/04/2020, 1:39 AMNick Smith
06/04/2020, 3:11 AMDavid Piepgrass
06/10/2020, 8:46 PMNick Smith
06/11/2020, 1:40 AMRobert Butler
06/11/2020, 5:03 PMdef do_it(x, y)
if x > y
x = x + y
else
x = x - y
end
end
number_x = read_from_stdin
number_y = read_from_stdin
do_it(number_x, number_y)
This is completely arbitrary, of course, but at which location can you reliably know you can avoid overflow? Any code that takes input could be handed values which cause an overflow at some point right? If you are duplicating logic (i.e. you have a 32-bit version, 64-bit version and perhaps more) how do you know which one to use? The only way you can know if it will overflow is essentially by doing the mathematical operation, so checking which path to take is at least as complicated as just doing it, which means you just need to do it and check for overflows and extend/retry with the next size. I'm having a hard time seeing how static analysis helps here except in arbitrarily small cases where you can compute the entire possible result space and prove it and all intermediate values are less than x-bits. I'm not sure if static analysis of this kind can really be reduced below the complexity of the halting problem, which is an NP-hard problem.Nick Smith
06/12/2020, 4:05 AMNick Smith
06/12/2020, 4:07 AMEdward de Jong / Beads Project
06/12/2020, 5:44 AMNick Smith
06/12/2020, 5:48 AMEdward de Jong / Beads Project
06/12/2020, 5:54 AMNick Smith
06/12/2020, 5:57 AMNick Smith
06/12/2020, 5:58 AMNick Smith
06/12/2020, 5:59 AMDavid Piepgrass
06/12/2020, 4:47 PMWouter
07/03/2020, 1:09 AM