News for hackers. Stuff that matters.
Re:Pingo: Plugins for Go by falcolas on Monday April 27, 2015 @02:51PM (#9448384)
Might I suggest a third communication method: stdin/stdout? It should be very easy to implement, would work better with really small process and would be much more cross-platform compatible without having to invoke the TCP stack.
Re:Pingo: Plugins for Go by rambocoder on Monday April 27, 2015 @02:36PM (#9448270)
Very cool.

I can see using this to construct an application made out of plugins, where their isolation provides fault tolerance, I can kill and restart a plugin as needed.

Now if it had heartbeat between the main process and plugins, so that unresponsive plugins would be killed and restarted automatically. Plus a restart strategy as a config parameter for the plugin so if the plugin dies, it can be restarted automatically. Basically a one_for_one restart strategy as in http://www.erlang.org/doc/design_principles/sup_princ.html

Does it make sense to panic in the constrctor https://github.com/dullgiulio/pingo/blob/master/plugin.go#L5... instead of returning nil, error

Re:Pingo: Plugins for Go by vezzy-fnord on Monday April 27, 2015 @02:41PM (#9448306)
Have you looked into Suture, which is just that - supervision trees for Go? (https://github.com/thejerf/suture)
Re:Pingo: Plugins for Go by rambocoder on Monday April 27, 2015 @03:32PM (#9448604)
I've looked at Suture before and now pairing it up with pingo might be a good idea because Suture can add supervision capability to this library.

As a standalone library, Suture gets close to what I want, except that the way Go's runtime works, if there is a panic in a goroutine, another goroutine cannot recover(), so if I create a service that suture supervises, and that service starts a goroutine that panics, suture will not handle it, the whole process will crash. Pingo get's rid of Go's shared heap memory, so if pingo's plugin panics, Suture could restart it, this maybe a good combination.

Re:Pingo: Plugins for Go by chuhnk on Monday April 27, 2015 @02:11PM (#9448096)
Hmm. So not to be critical but isn't this just rpc? It feels very much just like rpc development. If you look at the net/rpc package you basically do the identical thing.
Re:Pingo: Plugins for Go by frik on Monday April 27, 2015 @01:59PM (#9448001)
Great idea, as Go 1.4 currently only supports static linking this is huge - emulates dynamic linking a bit like Chrome/Firefox addons "sandbox" style.
Re:Pingo: Plugins for Go by vezzy-fnord on Monday April 27, 2015 @02:32PM (#9448243)
I wouldn't call it "huge". Using net/rpc to emulate shared library plugins has been the primary recommended technique to anyone raising the question for a while now. This simply makes it into a library.

Another method is using code generation: https://github.com/progrium/go-extpoints

Re:Pingo: Plugins for Go by eternalban on Monday April 27, 2015 @03:41PM (#9448637)
Agreed, not huge, and well known.

Code gen is probably the most sensible way to approach the static nature of Go (and also generics, when all is said and done ;). While it is true that the pluggable platform x on Go should allow for any compliant plugin, at deployment time, the plugin set is known and effectively static.

Irony here is that given that the chaining of tools is emerging as the most natural way to build up the feature sets, the fast compile time may not be so fast anymore.

Re:Pingo: Plugins for Go by skybrian on Monday April 27, 2015 @05:39PM (#9449275)
If you use go generate [1], you check in the generated code, and only the author of a library pays the cost of code generation, not all the downstream dependencies.

You pay a price for not recompiling from the real source; in particular, after a security bug is fixed in a code generator, the downstream libraries won't automatically regenerate their code.

On the other hand, it's no worse than ecosystems such as Maven or Linux distros where people commonly download binary libraries rather than compiling from source.

[1] https://blog.golang.org/generate

Re:Pingo: Plugins for Go by eternalban on Monday April 27, 2015 @07:44PM (#9449810)
There are other options. This thread interested me enough to start sketching out a different approach. I don't see the point of the maintainers of the exoskeleton generating an unbounded set of permutations.
Re:Pingo: Plugins for Go by fla on Monday April 27, 2015 @02:05PM (#9448057)
It's implemented as RPC over localhost. Doesn't replace dynamic linking, but can be very handy nonetheless ;)
Re:Pingo: Plugins for Go by aylons on Monday April 27, 2015 @01:32PM (#9447822)
The same name as a Python Library for single-board computers (though in Python, not Go): https://github.com/garoa/pingo
Re:Pingo: Plugins for Go by divan on Monday April 27, 2015 @02:44PM (#9448331)
I see this project as a helper for transition from "dynamic loading plugins" to "microservices" mindset :)
Re:Pingo: Plugins for Go by chuhnk on Monday April 27, 2015 @02:45PM (#9448341)
You'll see the extreme similarities to writing a microservice here https://github.com/asim/go-micro
Re:Pingo: Plugins for Go by Animats on Monday April 27, 2015 @02:41PM (#9448307)
This is very similar to Python's "multiprocessing" module.

What does it use for marshalling? JSON?

Re:Pingo: Plugins for Go by wtf_is_up on Monday April 27, 2015 @06:48PM (#9449591)
It's using Go's net/rpc package [1] from stdlib, so it would have to be encoding/gob [2], also from stdlib.

[1] https://golang.org/pkg/net/rpc/

[2] https://golang.org/pkg/encoding/gob/

Re:Pingo: Plugins for Go by jzelinskie on Monday April 27, 2015 @05:37PM (#9449265)
How is this different from the pattern established in database/sql?
Re:Pingo: Plugins for Go by fideloper on Monday April 27, 2015 @03:32PM (#9448603)
I'm curious about how this concept is accomplished with other compiled applications such as Apache and it's modules?
Re:Pingo: Plugins for Go by aninteger on Monday April 27, 2015 @01:26PM (#9447762)
The name choice is so close to a children's television show:

http://en.wikipedia.org/wiki/Pingu

Re:Pingo: Plugins for Go by Daishiman on Monday April 27, 2015 @02:41PM (#9448308)
And a slang for penis in many dialects of Spanish
Re:Pingo: Plugins for Go by misterbwong on Monday April 27, 2015 @01:48PM (#9447920)
Also the name of an actual company that provides phone cards/numbers for international calling: http://www.pingo.com/