ra’s avatarra’s Twitter Archive—№ 36,243

    1. disassembler is working in REPL! here's a comparison between machine code generated by stock clojure compiler and magic ✌🏽
      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 API
  1. …in reply to @ra
    just for fun here it is with the LLVM backend enabled 😮
    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 API
    1. …in reply to @ra
      mono's llvm backend is really fucking good
      1. …in reply to @ra
        there's two things at play here: 1. clojure's IFn interface boxes all its arguments by default 2. even invokePrim, the type hinted method behind IFn, does not emit intrinsics, but static method invocations. note the call in the stock version
        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 API
        1. …in reply to @ra
          the design of the compiler is based on the JVM implementation which can reliably depend on a runtime JIT to clean this kind of thing up, but that does not exist on the CLR. that's why magic prioritizes avoiding boxing and emitting intrinsics above all else.
          1. …in reply to @ra
            the approach *really* shines in the face of non-primitive value types, e.g. vector addition. the stock compiler's signature is object,object forcing it to unbox, while magic is able use the correct types and allow the LLVM backend to give us fast SIMD machine code
            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 API