News for hackers. Stuff that matters.
Re:Gollvm from Google by akavel on Saturday May 27, 2017 @12:29PM (#14430734)
"At the moment llvm-goparse is not capable of building the Go libraries + runtime (libgo), which makes it difficult/unwieldy to use for running actual Go programs. As an interim workaround, I've written a shim/wrapper script that allows you to use llvm-goparse in combination with an existing GCCGO installation, using gccgo for the runtime/libraries and the linking step, but llvm-goparse for any compilation."

Not sure I get it: so Gollvm (=llvm-goparse?) can be used as compiler, but not as a linker (yet?), so gccgo's linker can be used? Also, Go runtime and standard libraries can't be compiled with Gollvm? If standard libs can't be compiled, then how can I know if my app can be compiled?

I know a project named "llvm-go" was started quite long ago, and had somewhat slow (compared to gccgo) progress because of few, non-Google contributors (probably hobbyists); is this the same work? is it just still in progress, but somewhat more (how much?) advanced now?

Some additional googling shows a similarly named project (https://github.com/go-llvm/llvm), which from its readme seems absorbed by LLVM proper, and is subtitled "LLVM bindings for [Go]" (http://llvm.org/svn/llvm-project/llvm/trunk/bindings/go/READ...). Is this the same project, or something more, or something else? [EDIT:] Ok, based on the CONTRIBUTORS file, it's a totally different project, at least one question cleared. (https://go.googlesource.com/gollvm/+/master/CONTRIBUTORS)

Re:Gollvm from Google by geofft on Saturday May 27, 2017 @12:48PM (#14430798)
go-llvm/llvm appears to be a set of Go bindings to LLVM, i.e., the ability to access libllvm (embed LLVM and use it programatically) from a normal Go program. That is, you're using Go to drive LLVM, not LLVM to compile Go.

See the factorial example, where they build up some LLVM IR (in memory) for computing factorials: https://github.com/go-llvm/llvm/blob/master/examples/factori...

I'd guess the advantage of this is using LLVM's JIT at runtime.

Re:Gollvm from Google by mseepgood on Saturday May 27, 2017 @12:39PM (#14430765)
> Is this the same project, or something more, or something else?

Compare the source code:

http://llvm.org/svn/llvm-project/llvm/trunk/bindings/go/llvm...

https://go.googlesource.com/gollvm/+/master/llvm-gofrontend/

Re:Gollvm from Google by zik on Saturday May 27, 2017 @08:48PM (#14432625)
I think you're thinking of llgo, not go-llvm.