Are "plugins" good or not?

blov · · 500 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m a backend engineer from PHP to Go. Back to those days, when I have to compile extensions to <code>.so</code> files and put them in the sepcified path and enable it in the PHP configuration file .. that was totally a nightmare for me.</p> <p>And recently that there&#39;re some news about that you can use Plugins in Go 1.8 (you can even try it now with Go 1.8-beta), I&#39;m affraid something like that happend again.</p> <p>For example if there&#39;s a package that depends on a plugin, you would have to download or compile the plugin first, and then put it in somewhere, then you can finally use the package, I think this is a little bit complex for me. (though plugins are useful)</p> <p>What&#39;s your thoughts? Am I thinking with it in the wrong direction?</p> <hr/>**评论:**<br/><br/>tscs37: <pre><p>The difference is that PHP runs on top of a binary that uses these <code>.so</code> files while Go is largely self-contained.</p> <p>When a PHP package requires some extension, you need to install it.</p> <p>Go is (IMO) not meant to operate in that way, if you require an extension it should not be a plugin.</p> <p>I&#39;m more excited to see extensions in places like Caddyserver where it means making plugins of optional extensions. If one is missing the server works as before granted you&#39;re not using the configuration keys of the plugin.</p> <p>I also think that the Go Ecosystem should push a configuration free plugin system. Plugins should be enabled if present not if configured and a blacklist may be used if necessary.</p></pre>headzoo: <pre><blockquote> <p>Go is (IMO) not meant to operate in that way, if you require an extension it should not be a plugin.</p> </blockquote> <p>That&#39;s the way I see the plugin system being used as well. It&#39;s all about making the application extensible. For instance adding new credit card processors to an ecommerce app, or different types of file systems for image storage like local, S3, or Dropbox.</p></pre>tscs37: <pre><p>Exactly, this is what I plan to use it for; extensible storage and frontend options.</p> <p>I think a second, differently oriented option is to also have security modules.</p> <p>This would be interesting for Caddy too, as a special plugin could be used to patch security vulnerabilities in the server crypto, which is the main complaint (some but not me) people have with Go&#39;s static compilation.</p></pre>headzoo: <pre><p>That sounds like a great use as well. Configurable/extensible middleware too.</p></pre>

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

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