plugin package

248 views
Skip to first unread message

Sebastien Binet

unread,
Apr 20, 2015, 5:58:24 PM4/20/15
to golan...@googlegroups.com
hi there,

The support for the c-shared execution mode is progressing nicely
(yeah!) and bits and pieces of my evil plan of writing c-python
extension modules in Go are in place (yeah! (bis))

according to the "Go execution modes" document[0] a plugin package is
foreseen to standardize the loading of shared-object-backed packages.
is anybody working (or planning to work) on that package for go-1.5?

I am not sure to have the know-how to implement the
plugin.(Plugin).Lookup method but its C-counterpart seems in my
technical reach (provided an implementation relying on dlfcn.h is
allowed)
should I give it a go?

-s

[0]: https://docs.google.com/document/d/1nr-TQHw_er6GOQRsF6T43GGhFDelrAP0NqSS_00RgZQ/preview?sle=true

minux

unread,
Apr 20, 2015, 6:02:20 PM4/20/15
to Sebastien Binet, golang-dev

There is only about 10 days left before the 1.5 code freeze, so I doubt we have enough time to come up with a good design that we are willing to commit to.

Ian Lance Taylor

unread,
Apr 20, 2015, 6:44:49 PM4/20/15
to minux, Sebastien Binet, golang-dev
There is an API for the plugin package in the execution modes doc.

It's fine for those methods to call cgo functions. There is no other
reasonable way to do it.

Ian

minux

unread,
Apr 20, 2015, 10:07:30 PM4/20/15
to Ian Lance Taylor, Sebastien Binet, golang-dev
On Mon, Apr 20, 2015 at 6:44 PM, Ian Lance Taylor <ia...@golang.org> wrote:
On Mon, Apr 20, 2015 at 3:02 PM, minux <mi...@golang.org> wrote:
> There is only about 10 days left before the 1.5 code freeze, so I doubt we
> have enough time to come up with a good design that we are willing to commit
> to.

There is an API for the plugin package in the execution modes doc.

I still think there are more details to consider (sorry I didn't bring this up earlier).

The execution mode docs said that we are not going to provide a way to unload
a plugin (I don't think it's generally possible either), but why is there Close method
on Plugin if there is no way to actually unload a plugin? What does Close do?

If we remove Close method, should Open be called something else to hint that
there is no need to Close?

It's certainly cool and desirable to have the plugin interface. But as there are still
some ongoing work on the dso support, i think rush to a design for plugin support
in 10 days before code freeze is a little risky.

Sebastien Binet

unread,
Apr 21, 2015, 3:21:25 AM4/21/15
to minux, golang-dev
10 days. time flies...

ok. I'll tinker with it a bit in my own namespace and perhaps mail a
'DO NOT SUBMIT' CL at some point. (and perhaps update this thread
before)

-s
Reply all
Reply to author
Forward
0 new messages