Is it possible to include inline assembly in Google Go code?
+7
A:
There is no facility in the Go programming language to support in-line assembler language code, and there are no plans to do so. Go does support linking to routines written in assembler and C. There is an experimental feature which adds SWIG support to Go.
peterSO
2010-06-01 15:54:47
+1 A link for a reference would make this answer perfect ;)
OscarRyz
2010-06-01 16:15:34
@OscarReyes: Done
peterSO
2010-06-01 16:43:47
+1 Now it is perfect ! :)
OscarRyz
2010-06-01 17:00:36
It's not always necessary to use cgo to link to C code. cgo just allows calls into code compiled with GCC (for now) because Go uses an otherwise incompatible ABI. If you don't mind linking in the C code statically, you can simply write and compile it in the style of the runtime package: http://golang.org/src/pkg/runtime/. Any function starting with "·" -- a mid-dot -- is callable through Go.
Evan Shaw
2010-06-01 19:07:22
@Support: How can you upvote one answer twice? :-O
Jay Sinha
2010-07-02 18:17:31
@Jay, like this --> +1 ;)
OscarRyz
2010-07-03 01:45:43