What to do with LLVM and Bitcode?

687 views
Skip to first unread message

timcoo...@gmail.com

unread,
Nov 7, 2017, 8:34:04 AM11/7/17
to golang-dev
I'm a big user and fan of the gomobile tools and the cross-compiling features of Go. It's a brilliant piece of code to do cross platform mobile library development.

However with the introduction of Bitcode for iOS by Apple we are missing a big feature: Bitcode support. Of course this is not an issue in gomobile, the Go toolchains itself are missing Bitcode support.

What should be the approach to get Bitcode support in Go or a Go-based compiler?

I saw that some work is being done within Google's own public repositories in creating an front-end for LLVM for Go. I could imagine that having a LLVM front-end would also assist webassembly support.

Tim

Than McIntosh

unread,
Nov 7, 2017, 10:15:48 AM11/7/17
to timcoo...@gmail.com, golang-dev
Hi Tim,

Yes, we are in the process of getting a version of Go working with LLVM (I'm one of the folks working on this effort). Generating bitcode is certainly an idea that we've thought about, although there are still many other more important things we need to do first to get our compiler ready for "prime time".

Once you've actually generated LLVM IR for a Go program, it's pretty easy to spit out bitcode. The more interesting questions would be more around what sorts of rules + restrictions are imposed on the bitcode by the App Store, and exactly what gets done with it later on down the pike. 

Cheers, Than



--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stuart Carnie

unread,
Nov 7, 2017, 11:23:17 AM11/7/17
to golang-dev
Hi Than,

I've been watching the commits in anticipation of an announcement for a while now and wonder what goals you and the team have for go-llvm? Obviously using LLVM brings a lot of benefits to code generation.

Cheers,

Stuart
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.

Ian Lance Taylor

unread,
Nov 7, 2017, 12:57:35 PM11/7/17
to Stuart Carnie, golang-dev
On Tue, Nov 7, 2017 at 8:23 AM, Stuart Carnie <stuart...@gmail.com> wrote:
>
> I've been watching the commits in anticipation of an announcement for a
> while now and wonder what goals you and the team have for go-llvm? Obviously
> using LLVM brings a lot of benefits to code generation.

The basic goal is to have another alternative Go compiler with
different tradeoffs, along the lines of gccgo.

Ian

Stuart Carnie

unread,
Nov 7, 2017, 1:48:47 PM11/7/17
to golang-dev
Sounds great. Is the team taking outside contributions and is there a list of milestones / issues we could help with?

Wei....@arm.com

unread,
Mar 26, 2018, 9:53:43 PM3/26/18
to golang-dev
I'm a little confused and just ask a basic question:
What's the difference between go-llvm and llgo?

Thanks
Wei Xiao

Ian Lance Taylor

unread,
Mar 26, 2018, 10:22:03 PM3/26/18
to Wei....@arm.com, golang-dev
On Mon, Mar 26, 2018 at 6:53 PM, <Wei....@arm.com> wrote:
> I'm a little confused and just ask a basic question:
> What's the difference between go-llvm and llgo?

They are two different approaches to adding a Go frontend to the LLVM
compiler. Specifically, llgo starts with the standard library
go/parse and go/types packages. GoLLVM starts with the gofrontend
code that is used with gccgo.

Ian


> On Wednesday, November 8, 2017 at 1:57:35 AM UTC+8, Ian Lance Taylor wrote:
>>
>> On Tue, Nov 7, 2017 at 8:23 AM, Stuart Carnie <stuart...@gmail.com> wrote:
>> >
>> > I've been watching the commits in anticipation of an announcement for a
>> > while now and wonder what goals you and the team have for go-llvm?
>> > Obviously
>> > using LLVM brings a lot of benefits to code generation.
>>
>> The basic goal is to have another alternative Go compiler with
>> different tradeoffs, along the lines of gccgo.
>>
>> Ian
>

Andrew Wilkins

unread,
Mar 27, 2018, 5:33:11 AM3/27/18
to golang-dev
On Tuesday, March 27, 2018 at 10:22:03 AM UTC+8, Ian Lance Taylor wrote:
On Mon, Mar 26, 2018 at 6:53 PM,  <Wei....@arm.com> wrote:
> I'm a little confused and just ask a basic question:
> What's the difference between go-llvm and llgo?

They are two different approaches to adding a Go frontend to the LLVM
compiler.  Specifically, llgo starts with the standard library
go/parse and go/types packages.  GoLLVM starts with the gofrontend
code that is used with gccgo.

Another significant difference is that llgo is moribund. Sadly I haven't had the time or energy for it for a long time, and it doesn't look like pcc has either.
Reply all
Reply to author
Forward
0 new messages