On Monday, 22 October 2018 07:17:57 UTC+2, Ian Lance Taylor wrote:
>
> On Sat, Oct 20, 2018 at 1:26 PM, jclc via golang-nuts 
> <golan...@googlegroups.com <javascript:>> wrote: 
> > 
> > Currently I don't use them, but couldn't binary packages be used to 
> > distribute CGO-dependent packages for developers who might not have a C 
> > cross-compiler? I think the feature would be more commonly used if it 
> wasn't 
> > so impractical. Rather than abandoning the feature I'd like to see it 
> > revamped to work well with modules. 
>
> You shouldn't need to use binary packages for that.  It's OK to 
> distribute C code as a binary, as a .syso file.  The issue is there is 
> distributing the Go code as a binary. 
>
> Ian 
>


Go can produce c-archive and c-shared binaries that can be consumed by C 
and then, perhaps even unbeknownst to the go programmer, the c library they 
use via cgo has Go in it somewhere.

I think that this situation would lead to a mix of Go binary and source in 
any case.  I also think it might be desirable, so that 
Go code can provide functionality that C code depends on.  I mean, a 
project that publishes a C library and decides to use Go for part of its 
implementation should not have to say "we use Go so if you use cgo, then 
..."

This combination is perhaps hypothetical at this point for Go, but there 
are low level Rust libraries like this where the consumer doesn't need to 
know whether or not it is or has parts implemented in rust. 

Scott






 

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

Reply via email to