TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Golang Package: plugin

107 pointsby pythonistover 8 years ago

8 comments

guessmynameover 8 years ago
I agree with this comment from Reddit four days ago:<p>&gt; The inability to unload a plugin defeats the use I would have for this, unfortunately. A long running service with plugins may want to load new, updated versions of an existing plugin. Not being able to unload the old version, ends up creating stale references which will keep piling up for the lifetime of the process. As I understand it, this is essentially a memory leak. [...]<p>&gt; <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;golang&#x2F;comments&#x2F;53adu8&#x2F;a&#x2F;d7rmmco" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;golang&#x2F;comments&#x2F;53adu8&#x2F;a&#x2F;d7rmmco</a><p>There is also this project by Hashicorp: <a href="https:&#x2F;&#x2F;github.com&#x2F;hashicorp&#x2F;go-plugin" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hashicorp&#x2F;go-plugin</a>
zupa-huover 8 years ago
Amazing, so this is essentially a high performance alternative to Go scripting. One can already include the go build toolchain in a binary, right? Having JIT is only small steps away.<p>Disagree with the problem of unloading plugins. From the sizes of Go binaries and memory sizes, one could easily load 10k+ plugins before the process needed a restart. Would be nice to have GC, but having plugins is such an increased benefit. To me this sounds like, Git is crap because you can&#x27;t unload stored objects.
pjmlpover 8 years ago
Nice to see this coming, one step closer to have Oberon System 3 with Gadgets rewritten in Go. :)
gtrubetskoyover 8 years ago
Curious what it would take (if at all possible?) to load such a .so from C. Because that would open the door for writing Go libs for all your favorite interpreted languages, web servers, etc.
评论 #12555910 未加载
评论 #12556113 未加载
评论 #12557524 未加载
评论 #12556028 未加载
ortaover 8 years ago
This is awesome, a plugin structure like this is one of the fundamentals of macOS programming (they&#x27;re called NSBundles in those cases.)
junkeover 8 years ago
&gt; A plugin is only initialized once, and cannot be closed.<p>Why not?
评论 #12556061 未加载
评论 #12556251 未加载
spepsover 8 years ago
I see an API fail coming. It seems plugin.Load takes the filename WITH extension where it shouldn&#x27;t. Okay, right now it seems it&#x27;s only supported on Linux but it ends up in Windows, you&#x27;d have to patch code to remove the .so. Mono handles it pretty well, the extension is optional.
评论 #12556050 未加载
评论 #12556027 未加载
评论 #12556603 未加载
SoapSellerover 8 years ago
Didn&#x27;t one of the main selling points of Go is one big static executable with no external dependencies?<p>What&#x27;s next? Generics?
评论 #12556194 未加载
评论 #12556199 未加载
评论 #12559079 未加载
评论 #12557383 未加载
评论 #12559080 未加载