5 ms·
Cool! I have been doing this kind of programming with dynasm [*] and finding it addictive. I wonder if assembler is going to make a come back :). https://githu
by lukego 11y ago
Cool! I have been doing this kind of programming with dynasm [*] and finding it addictive. I wonder if assembler is going to make a come back :).
https://github.com/luapower/dynasm/blob/master/dynasm.md https://github.com/luapower/dynasm/blob/master/dynasm.md
- csl 11y agoI 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?
- _RPM 11y ago> I wonder if assembler is going to make a come back :) Are you trolling? Assembler hasn't gone anywhere nor will it ever.
- agumonkey 11y agoA typed assembly would be in order.
- nickpsecurity 11y agoGo get, use and improve them: http://www.cs.cornell.edu/talc/ http://www.cs.cornell.edu/talc/ http://research.microsoft.com/en-us/um/people/nick/coqasm.pdf http://research.microsoft.com/en-us/um/people/nick/coqasm.pd...
- nickpsecurity 11y agoIt likely won't for mainstream but it's always been popular in niche areas. Here's a few projects using it and pages on it: KolibriOS http://kolibrios.org/en/ http://kolibrios.org/en/ Anything by 2ton and w/ their library https://2ton.com.au/Products/ https://2ton.com.au/Products/ Gibson's guide on Win32 Assembly w/ links https://www.grc.com/smgassembly.htm https://www.grc.com/smgassembly.htm Hyde's AoA and High-level Assembly are cool http://www.plantation-productions.com/Webster/ http://www.plantation-productions.com/Webster/ Or for the elite: 8-bit GUI desktop http://www.symbos.de/ http://www.symbos.de/
- lfowles 11y agoThere was a bit of hate for Hyde's HLA last time I posted a link. I'm really not sure why, theoretically it's a great intermediate between C and ASM.
- nickpsecurity 11y agoSame thing happened to me when I posted. The gist of it is they thought you weren't learning real ASM thinking that way. I thought the point was to temporarily ignore more difficult parts of ASM to make learning incremental and easier. And then be able to do same as real assembly coder later w/ ability to make tradeoffs between raw performance, productivity, and easy-to-read code. Overall, a great tool in theory. Also, gave me ideas on how to bootstrap a subversion-resistant system. You start with assembler, build a HLA-like tool from that, easily build a 3GL + straight-to-HLA compiler with that, and then use that to build rest (including optimizations). My concept was inspired by Wirth and Jurg's bitslice -> M-code ASM -> Modula 2 -> OS work in Lilith project. Alternatively, you can go MenuetOS or KolibriOS w/ HLA for above benefits. Use full HLA for rapid addition/testing of new features with raw ASM for optimizing the fast paths. Thoughts on either?