News for hackers. Stuff that matters.
Re:Show HN: C to Go Assembly by justinclift on Wednesday May 24, 2017 @04:27PM (#14413171)
Probably worth mentioning the blog post too: https://blog.minio.io/c2goasm-c-to-go-assembly-bb723d2f777f

Out of curiosity, any idea how well does Go asm works with Delve (the Go debugger)?

Re:Show HN: C to Go Assembly by akavel on Thursday May 25, 2017 @04:34AM (#14416051)
Haven't tried it personally, but based on a recent article shared at r/golang (https://rakyll.org/coredumps/, via https://www.reddit.com/r/golang/comments/6cvtd6/debugging_go...), delve seems to show the contents of an .s file allright.
Re:Show HN: C to Go Assembly by justinclift on Thursday May 25, 2017 @06:29AM (#14416413)
Thanks, that's a useful article.

Just wish core dumping Go programs worked on OSX. Hopefully one day. :)

Re:Show HN: C to Go Assembly by fwessels on Wednesday May 24, 2017 @07:19PM (#14414212)
That is a good question but have never tried it. However, there is nothing "special" about the assembly as ported by c2goasm, so it should equally well as any other (hand-crafted) assembly.
Re:Show HN: C to Go Assembly by theparanoid on Thursday May 25, 2017 @03:06AM (#14415785)
Go needs another option other than assembly. Either compiler intrinsics like C/C++ or something, anything, else.
Re:Show HN: C to Go Assembly by tankenmate on Thursday May 25, 2017 @10:48AM (#14417637)
It does, cgo.
Re:Show HN: C to Go Assembly by mhh__ on Wednesday May 24, 2017 @07:44PM (#14414313)
So, is go assembly the IR inside the Go compiler?
Re:Show HN: C to Go Assembly by fwessels on Wednesday May 24, 2017 @07:55PM (#14414354)
No, it is not an IR code such as in Java or .Net. At compile time it is translated into opcodes for the corresponding architecture that you are compiling for.
Re:Show HN: C to Go Assembly by chrisseaton on Wednesday May 24, 2017 @09:11PM (#14414670)
I disagree. I think saying that it's the lowered intermediate representation in the Go compiler pipeline is a really good description. It's equivalent to the LIR in Java's C2 compiler. I'm not sure what the equivalent is in .net.

Fundamentally, it's a representation and it's intermediate isn't it?

Re:Show HN: C to Go Assembly by uluyol on Thursday May 25, 2017 @12:08AM (#14415244)
No, not really. Go's assembly might be considered somewhat higher level than regular assembly code, but it's certainly architecture specific. The examples highlighted use x86 SIMD instructions unavailable on other architectures.

Freedoms taken by the go assemblers also seem to be decreasing as the compiler becomes smarter. E.g. instruction reordering is no longer performed (https://github.com/golang/go/issues/15837).

You can read about the assemblers here: https://golang.org/doc/asm

Re:Show HN: C to Go Assembly by chrisseaton on Thursday May 25, 2017 @04:55AM (#14416114)
Yes I know it's architecture specific. Many lowered IRs are. The equivalent I gave, Java's C2 IR, is also architecture specific, which is why I used it.