5 ms·
I wonder if assembler is going to make a come back :). I'm certainly seeing a lot of cool projects that make assembly more accessible, not to mention a lot of
by csl 11y ago
I wonder if assembler is going to make a come back :).
I'm certainly seeing a lot of cool projects that make assembly more accessible, not to mention a lot of good guides on the web. As for myself, I've recently made Python ctypes bindings for GNU Lightning, which lets you write architecture agnostic RISC assembly, then JIT to native code on x86, ARM, etc. See https://github.com/cslarsen/lyn/ https://github.com/cslarsen/lyn/
It's pretty light-weight and JITs fast. The point is that it's very fun and addictive to do assembly from a language like Python.
- dr_zoidberg 11y agoIt's pretty light-weight and JITs fast. The point is that it's very fun and addictive to do assembly from a language like Python. Because you skip the boring boilerplate, and go straight to the fun parts!
- lfowles 11y agoMy biggest problem with assembly was coming up with names for all of the labels :) One of the hardest problems of CS... naming! How does PeachPY handle loops? I'm looking for examples, but will it generate a label for me and then let me specify the contents only? Edit: https://github.com/Maratyszcza/PeachPy/blob/master/examples/make/matmul-opt.py https://github.com/Maratyszcza/PeachPy/blob/master/examples/... ! (Add a bit more, give it some static typing and soon we'll be coding C in Python)
- pbsd 11y agoThat's how you unroll a loop, not how you write one. As far as I can tell in PeachPy you can do something similar with anonymous labels: counter = GeneralPurposeRegister64() MOV(counter, 64) with Loop() as loop: ... DEC(counter) JNZ(loop.begin)
- lfowles 11y agoThanks for the clarification, that's still a decent improvement.
- nickpsecurity 11y agoI proposed a while back to replace inline assembler with inline LLVM bytecode. Do the portable code thing in general except accelerate the algorithms with the bytecode. Toolchain produces assembly from that. Probably still have real assembly where it's needed for hardware manipulation, etc but I'd think you'd get quite the performance/optimization improvement with that over C. What you think about LLVM as cross-platform assembly?