News for hackers. Stuff that matters.
Re:Golang Package: plugin by SoapSeller on Thursday September 22, 2016 @07:56AM (#12556180)
Didn't one of the main selling points of Go is one big static executable with no external dependencies?

What's next? Generics?

Re:Golang Package: plugin by dvirsky on Thursday September 22, 2016 @08:00AM (#12556194)
Although this can be abused, the use case is not external dependencies IMO, but rather extending systems. Think of a web server etc. Each plugin is still a static binary that is self contained, but you can load capabilities into the server in runtime.

This is not like dynamic linking hell you can get yourself into when writing C.

Re:Golang Package: plugin by wtbob on Thursday September 22, 2016 @09:54AM (#12556806)
> Each plugin is still a static binary that is self contained, but you can load capabilities into the server in runtime.

In my Go code, I've just used subprocesses for that. Stdin & stdout, plus a simple serialisation format, and I'm done.

Not suitable for high performance stuff, of course, but good enough for my needs.

Re:Golang Package: plugin by dvirsky on Thursday September 22, 2016 @09:57AM (#12556826)
yeah, it could work for sure if latency is not an issue. It's also possible to do a go->C->go bridge to load Go plugins dynamically.
Re:Golang Package: plugin by clappski on Thursday September 22, 2016 @08:08AM (#12556223)
But isn't that exactly how dynamic linking works? By loading a DLL at runtime? The only issues I've ever had with dynamic linking are at _runtime_, where XXX.dll can't be found.
Re:Golang Package: plugin by dvirsky on Thursday September 22, 2016 @08:18AM (#12556263)
yes, my above comment wasn't phrased that well. but do distinguish between a plugin system where you load so's or DLLs to extend an app, and an application that has dynamic linking against them, where the linker handles this.

So basically something like apache modules - either you can load the module or not - vs something like "cannot find symbol foo in foo.so.0.1."

Re:Golang Package: plugin by pjmlp on Friday September 23, 2016 @02:55AM (#12562807)
> This is not like dynamic linking hell you can get yourself into when writing C.

No, but they will eventually need to handle plugin versions.

Re:Golang Package: plugin by StavrosK on Thursday September 22, 2016 @08:01AM (#12556199)
Are you saying that, in cases where that's not possible, you'd rather not have a program at all instead of a program with external dependencies?

Because that doesn't sound very reasonable to me, even after ignoring that plugins aren't really dependencies anyway.

Re:Golang Package: plugin by stirner on Thursday September 22, 2016 @02:40PM (#12559079)
Standard library packages are not the same thing as the language and are not mentioned in the Go specification. The standard library is just a collection of packages that implement common functionalities that might otherwise lead to multiple competing implementations (like hyper, tiny_http, rotor-http, and solicit in Rust). Including a plugin mechanism is not an endorsement of that style of architecture, but simply an acknowledgement that there are programs that will need plugins.
Re:Golang Package: plugin by nine_k on Thursday September 22, 2016 @11:16AM (#12557383)
Generics would be great, but they are much trickier. It took Java many years to implement them, while having fewer runtime constraints.