Native Client (NaCl) 程序可以用 C 或 C++ 以外的语言编写吗?
是否可以用 Python 或 Go 编写一个可以在浏览器中运行的本机客户端应用程序?
Would it be possible to write a native client application in Python or Go that could then run in the browser?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Go 曾经编译为 NaCl,但 NaCl 一直是一个不断变化的目标,以至于 Go 中删除了支持。如果/当氯化钠稳定下来时,它可能会在某个时候复活。
Go used to compile to NaCl, but NaCl's been such a moving target that the support was removed from Go. It'll probably be resurrected at some point if/when NaCl settles down.
这在架构上是可行的,但据我所知,当前的 SDK 仅具有 C/C++ 工具链。他们将 Python REPL 作为基于浏览器的客户端运行(配有标准库和 sqlite http://lackingrhoticity.blogspot.com/2009/06/python-standard-library-in-native.html)。
It is architecturally possible, but the current SDK only has C/C++ toolchains as far as I can tell. They have the Python REPL running as a browser-based client (complete with standard library and sqlite http://lackingrhoticity.blogspot.com/2009/06/python-standard-library-in-native.html ).
从 Go 1.3 开始(再次)支持 NaCL。
请参阅 Golang 1.3 发行说明。
从 Go 1.2 开始已过时的答案:
The NaCL is (again) supported since Go 1.3.
See Golang 1.3 release notes.
Obsolete answer as of Go 1.2:
如果您下载 NaCl 工具链,您将看到:
注意 gfortran 已经存在。同样,单声道支持可用(请参阅 https://github.com/elijahtaylor/mono),因此任何.net 语言原则上也是可行的。 Unity3d游戏引擎框架使用C#和mono并导出到NativeClient。
if you download the NaCl toolchain, you'll see:
Note gfortran is already present. Likewise, mono support is available (see https://github.com/elijahtaylor/mono), and thus any .net language is also in principle feasible. The Unity3d game engine framework uses C# and mono and exports to NativeClient.