ra’s avatarra’s Twitter Archive—№ 30,165

          1. played around with a peephole pass last night to get rid of needless casts. same code w/o and w/peephole:
            oh my god twitter doesn’t include alt text from images in their APIoh my god twitter doesn’t include alt text from images in their APIoh my god twitter doesn’t include alt text from images in their API
        1. …in reply to @ra
          clojure int literals are longs. but there’s never a reason to emit a long constant then cast it to an int, so that pattern gets replaced.
      1. …in reply to @ra
        same: vector multiplication is defined for floats, but the user typed a long literal. no reason to emit and cast.
        oh my god twitter doesn’t include alt text from images in their APIoh my god twitter doesn’t include alt text from images in their APIoh my god twitter doesn’t include alt text from images in their API
    1. …in reply to @ra
      casting is not slow on the CLR – unless you cast a value type to an object, which boxes. that incurs allocation + GC cost, which can be slow
  1. …in reply to @ra
    across the board i am trying to be as principled with the bytecode as possible… the CLR does not have a runtime JIT to clean things up