4 ms·
The toolchain part of Go is very interesting (I only know the basics). Go doesn't use GCC, LLVM or other existing compilers. Go's compiler/linker originated f
by kyrra 12y ago
The toolchain part of Go is very interesting (I only know the basics). Go doesn't use GCC, LLVM or other existing compilers. Go's compiler/linker originated from the Plan9 C compiler (that Rob and Ken worked on)[0]. Because of this, it allows you to create binaries for any target platform from any platform you have the Go toolchain on. So from my OSX macbook, I can compile Windows and Linux executables.
When you start diving into it a a bit more, you'll see that Go has it's own ASM language[1] that your code is first compiled into (which then can be translated into specific os/platform asm).
This has it's own ups and downs. Debuggers don't work all that well on Go generated executables (gdb is the closest, even that one isn't all that great). You also don't have the years of optimizations that GCC and LLVM bring to the table. But the Go team has tight control of the tools, which allow for quick compilation and allow them to pick their own direction.
[0] https://golang.org/cmd/gc/ https://golang.org/cmd/gc/
[1] https://golang.org/doc/asm https://golang.org/doc/asm
- MetaCosm 12y agoYeah, a lot of magic lives at the tooling layer, and Go is going to leverage that with Go Generate in Go 1.4+. A lot of great tools already leverage that core. I like that fact that a lot of the tooling/editor support is not picking a winner nor demanding an IDE. Tools like errcheck, goimports, gorename (announced today), oracle, gocode, godef, godoc, gofmt, golint, gotags, ... (on and on) ... all can be leverage by IDEs, emacs, sublime, vim and others equally... or just used from a console or in your own stacks.
- krakensden 12y agoThere's gccgo, and it certainly has a reputation for beating gc/6g in numeric computation, but IIRC it didn't have a huge edge overall.
- NateDad 12y agoGccgo misses out on some key optimizations, like escape analysis IIRC, and therefore on real world tests usually is not as fast as gc. Also, since gc is the de facto standard, it has a LOT more real world testing. Gccgo has a few bugs (I forget exactly, something about embedding an interface or something just causes a panic - avoidable, but frustrating).