Plugin language/package recommendations

blov · · 554 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m working on a forum in Go and while things are going pretty well so far, I&#39;d like to set up some kind of plugin system using Python, Lua, or Javascript to make it easier for others who aren&#39;t familiar with Go to contribute. What would you guys recommend, taking into consideration flexibility and ideally low overhead?</p> <hr/>**评论:**<br/><br/>natefinch: <pre><p>Take a look at <a href="https://github.com/natefinch/pie" rel="nofollow">https://github.com/natefinch/pie</a> - it supports plugins in any language as long as they support JSON RPC. </p> <p>Though Lua is a pretty good solution too. </p></pre>ChristophBerger: <pre><p>There have been many different approaches to implementing plugins in Go, from talking to external processes via stdin/stdout (as the already mentioned <a href="https://github.com/natefinch/pie" rel="nofollow">pie</a>, or <a href="https://github.com/hashicorp/go-plugin" rel="nofollow">go-plugin</a>, or messaging systems like <a href="https://github.com/go-mangos/mangos" rel="nofollow">Mangos</a>, to complete scripting language subsystems, like <a href="https://github.com/yuin/gopher-lua" rel="nofollow">GopherLua</a>, <a href="https://github.com/robertkrimen/otto" rel="nofollow">Otto</a> (Javascript), or <a href="https://github.com/PuerkitoBio/agora" rel="nofollow">Agora</a>.</p> <p>I wrote a round-up of these approaches (plus a tiny demo implementation using RPC) some time ago (especially, at a time before Go got its own <a href="https://golang.org/pkg/plugin/" rel="nofollow">plugin system</a> on Linux) in <a href="https://appliedgo.net/plugins/" rel="nofollow">this blog article</a>.</p></pre>eggbertx: <pre><p>I...somehow didn&#39;t know about the plugin system.</p></pre>ChristophBerger: <pre><p>Perhaps because it is not fully supported across platforms yet. Certainly it would have been more prominently announced (and more widely used and written about) if it came with support for macOS and Windows in 1.8. Let&#39;s see what 1.9 brings...</p></pre>captncraig: <pre><p>It has a slew of other things going against it too. Can&#39;t unload plugins. Requires exact same version of all packages in common between host and plugin.</p> <p>I honestly can&#39;t see very many use cases that don&#39;t devolve into really painful scenarios once either side needs to update pretty much anything.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

554 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传