libuv bindings for Golang?

agolangf · · 831 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I found this one: <a href="https://github.com/mattn/go-uv" rel="nofollow">https://github.com/mattn/go-uv</a> but it hasn&#39;t been touched in a couple of years. Anything out there I&#39;m missing?</p> <hr/>**评论:**<br/><br/>ar1819: <pre><p>Why do you need those? &#34;Async&#34; programming is builtin in Go using goroutines and channels. &#34;io&#34; library is actually abstracting some of it for you. &#34;net&#34; lib abstracts almost everything. So I really curios why do you need it.</p></pre>andrewjsledge: <pre><p>I&#39;d like to be able to take an existing application (that uses libuv) and with minimal work port it to Golang.</p></pre>ar1819: <pre><p>I would definitely not recommend it. Aside from being non &#34;Go way&#34;, this will introduce a &#34;huge&#34; (in high concurrent applications) performance gap for calling C code and kill many of runtime planner performance bonuses. Don&#39;t get me wrong - I&#39;m not saying that you shouldn&#39;t use Go. I just think you should think about &#34;benefits&#34;. Will be they convincing enough if Go used in such way. You will be basically fighting language and it&#39;s way of doing things. Wouldn&#39;t it hit your productivity?</p> <p>Anyway if you sure about this, I don&#39;t think you need bindings - just use cgo. You&#39;ll need any decent C compiler on Linux \ *BSD or MinGW on Windows. Keep in mind, that cgo introduce &#34;compile time&#34; performance hit, so your build times will not be as fast, as using pure Go. But that depends on your project size.</p> <p>Edit: rephrasing</p></pre>bonekeeper: <pre><p>Go gives you all the benefits of UV without the complication of callbacks, state machines, etc. You can &#34;port&#34; a libuv based application to Go by simply writing it as you would normally do with any Go application. Think of it as the Go runtime already having libuv built-in behind the scenes doing the hard work for you. More than that, it also gives you multi-core for free, on top of libuv&#39;s concurrency.</p></pre>mattn: <pre><p>I&#39;m author. I no longer found a future in it.</p></pre>

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

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