4 ms·
In my view this type of system will only be usable by Real Computer Scientists and will completely kill off the workaday hacker. Think of all the people who bit
by jeffbee 5y ago
In my view this type of system will only be usable by Real Computer Scientists and will completely kill off the workaday hacker. Think of all the people who bitterly complain that a C++ compiler does something unexpected under the banner of UB. That crowd cannot cope with a world in which you have to exactly describe your requirements to an AI. It is also analogous to TDD, so all the TDD haters, which is the overwhelming majority of hackers, are toast.
- meken 5y agoWhat’s a workaday hacker and what’s UB?
- 331c8c71 5y agoundefined behavior
- kilotaras 5y agoUB = undefined behaviour. You can write code that is valid as in "can be compiled" but outside of C++ standard. It is duty of programmer to not have those, as compiler usually assumes that there's no UB in your code and can do unintuitive things with optimizations. e.g int foo(int8_t x) { x += 120 return x; } int bar(int8_t y) { int z = foo(y); if (y > 8) { do_important_thing(z); } } `do_important_thing` may be optimized out because: 1. signed overflow is a UB. Compiler than assumes that everything passed to foo is less than 8; 2. We pass y to foo => y < 8 3. if branch can then be optimized out
- jcranmer 5y agoTo be pedantic, C has no 8- or 16-bit addition operators, since everything sub-int is scaled up to int to do arithmetic. Therefore, the `x += 120;` line never overflows, since it is actually `x = (int8_t)((int)x + 120);`, and the possible range of `(int)x + 120` is comfortably within the range of expressible ints, while the conversion to int8_t is defined to wrap around when oversized. So there compiler can't optimize out do_important_thing in your example.
- discreteevent 5y agoI hope you don't mean to imply that TDD haters are not real computer scientists. http://ravimohan.blogspot.com/2007/04/learning-from-sudoku-solvers.html?m=1 http://ravimohan.blogspot.com/2007/04/learning-from-sudoku-s...