5 ms·
I 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 assemb
by bennofs 9y ago
I 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.