在Go语言中编写Node.js插件是否可行?

huangapple go评论103阅读模式
英文:

Is it possible to write node.js addons in go?

问题

我猜这一切都取决于libuv和其他C/C++的粘合剂是否可以在Go可执行文件中进行某种模拟。这可能吗?如果是的,你能提供一些开始的指导吗?

谢谢!

英文:

I guess it's all about whether libuv and the other c/cpp glue can be somehow imitated from within a go executable. Is it possible? If yes, could you provide some guidance on where to start?

Thanks!

答案1

得分: 1

目前使用Go构建共享对象(shared objects)并动态链接到系统中是不可能的(读作非常复杂)。正因为这个原因,Go只能通过CGI或Fast-CGI与其他Web服务器进行接口交互。

所以我的答案是不能直接实现。也许你可以通过IPC和一个链接到Node的小型C-"代理"来实现一些功能。

英文:

At the moment it is not possible (read very complicated) to build shared objects with Go, as to dynamically link them into a system. It's for this same reason that Go can only interface with other web servers through CGI or Fast-CGI.

So my answer would be not directly. maybe you could achieve something through IPC and a small C-"proxy" that's linked into node.

huangapple
  • 本文由 发表于 2012年8月23日 17:45:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/12088937.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定