3 ms·
You are surely joking. It would have to make a static inference that a numeric variable is converted to a string variable, then processed as a string to base 2
by yholio 5y ago
You are surely joking. It would have to make a static inference that a numeric variable is converted to a string variable, then processed as a string to base 2 representation, then truncated as a string that can only contain the '1' and '0' characters, then converted back into binary.
- chrisseaton 5y ago> It would have to make a static inference Not necessarily a static inference... could be speculative. Code folding golf is a bit of a hobby of mine. For example you can optimise through the string-integer conversion by storing a special string that remembers it was originally an integer and returning that value again instead of re-parsing. I work on a compiler that does that one for real, for example. I don't seriously think Rust does this right now, but would be a challenge to try.