News for hackers. Stuff that matters.
Re:Golang on ARM by vferreira on Tuesday November 17, 2015 @03:37PM (#10583786)
How about the support by the LLVM. Shouldn't this be enough?
Re:Golang on ARM by kyrra on Tuesday November 17, 2015 @03:40PM (#10583796)
Go already has 2 compiler implementations. There is gc (Go Compiler) and gccgo[0].

[0] https://golang.org/doc/install/gccgo

Re:Golang on ARM by frame_perfect on Tuesday November 17, 2015 @04:56PM (#10584267)
But LLVM already has a lot of good backends (emscripten, arm, ppc, x86, amd64). Why reinvent the wheel when you could just make Go a LLVM frontend and be done with it?
Re:Golang on ARM by bassislife on Tuesday November 17, 2015 @05:46PM (#10584575)
Compile times ? Flexibility over the backend ?

That would be my hunch. I think it makes a lot of sense. Also, note that there is that project which exists : http://llvm.org/viewvc/llvm-project/llgo/

Re:Golang on ARM by pcwalton on Tuesday November 17, 2015 @05:51PM (#10584600)
> Compile times ?

There can be a compile time hit, but you can use FastISel, which is not bad. The compile time hit is mitigated by the fact that you get a far, far more mature series of optimization passes. Since the Go compiler is itself written in Go, more optimizations would make the Go compiler itself faster, further reducing the performance impact.

> Flexibility over the backend ?

Writing to LLVM in no way restricts you to a backend. You simply need a language-level IR that you can retarget to different backends as you would like. This is what Swift, for example, is doing with SIL.

Re:Golang on ARM by bassislife on Tuesday November 17, 2015 @07:25PM (#10585043)
> Writing to LLVM in no way restricts you to a backend. You simply need a language-level IR that you can retarget to different backends as you would like.

It still ignores toolchain flexibility. Especially given the specific needs of Go's managed runtime.

[deleted]
Re:Golang on ARM by bassislife on Tuesday November 17, 2015 @08:26PM (#10585302)
> which LLVM now supports

Key word being "now".

I think you understood rather well.

Also have a look at the supported architectures paragraph in the documents you linked.

Re:Golang on ARM by sunnyps on Tuesday November 17, 2015 @09:23PM (#10585513)
And go 1.4+ doesn't just need segmented stacks but also moveable stacks. I do not know if LLVM has that yet.
Re:Golang on ARM by zik on Tuesday November 17, 2015 @06:58PM (#10584917)
It's mostly because the Go compiler was developed out of the plan9 compiler code base, which is unrelated to llvm.

The other aspect is that the Go compiler is intended to be very fast. That's not an explicit design goal of llvm - using llvm would slow the compiler down although it would have other advantages.

Re:Golang on ARM by 4ad on Wednesday November 18, 2015 @08:16AM (#10587483)
I wrote the arm64 and sparc64 Go backends because it was easy. If I were to have retargeted LLVM, I wouldn't even have finished the first one, and I would have hated my life.

In the meantime, Go still supports more hardware ISAs than LLVM. Apparently reinventing the wheel is much cheaper than adding wheels to the old car.