3 ms·
I'm curious to see what the decompiler would show if it were run over binaries produced by Go or Rust. This might be an invaluable tool to help programmers in h
by maxaf 9y ago
I'm curious to see what the decompiler would show if it were run over binaries produced by Go or Rust. This might be an invaluable tool to help programmers in higher level languages than C understand what really goes on under the hood.
- runevault 9y agoDepends, with rust for example it may not generate that different a code in some cases, but the compiler checked at compile time to make certain you weren't doing certain bad things.
- bennofs 9y agoI haven't tried it, but I would be very surprised if it yielded good results for go code. Go assembly, from what I've seen, looks very different from the assembly produced by a C compiler. In particular, the calling convention will be different and everything involving strings or other non-integer types will be completely different.
- matt-noonan 9y agoActually, I'd expect Go to work really well! Not if you tried to generate C code that compiles to a given Go binary, of course. But that's not what you'd do. Instead, you'd use the Go compiler as the black box, and learn Go code to produce the given binary. And for that, Go might work better than C: the speed of the compiler would help churn through generations that much faster.
- XR0CSWV3h3kZWg 9y agoIs go compilation that much faster?
- zik 9y agoGo compilation prioritises compile speed over executable speed by default. It's very fast.
- XR0CSWV3h3kZWg 9y agoIs it faster than gcc -O1?
- zik 9y agoFrom memory yes, it's a lot faster. Compile/link of programs with a few thousand lines of code typically takes on the order of a fraction of a second to a second.