英文:
Can Native Client (NaCl) programs be written in languages other than C or C++?
问题
能否用Python或Go编写一个本地客户端应用程序,然后在浏览器中运行?
英文:
Would it be possible to write a native client application in Python or Go that could then run in the browser?
答案1
得分: 8
Go曾经用于编译到NaCl,但是NaCl一直在不断变化,所以Go的支持被移除了。如果NaCl稳定下来,很可能会在某个时候重新启用。
英文:
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.
答案2
得分: 6
它在架构上是可能的,但据我所知,当前的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 ).
答案3
得分: 6
自Go 1.3版本开始,NaCL(再次)得到支持。
请参阅Golang 1.3发布说明。
截至Go 1.2版本,以下回答已过时:
> 据报道,NaCl将在Go 1.3中得到支持:
>
> 引用自Go 1.3 Native Client Support文档:
> > Go 1.3将包括支持在Google的基于SFI的执行沙箱中运行命令行程序的功能。
>
> 引用自Inside the Go Playground Go博客:
> > Native Client(或“NaCl”)是由Google开发的一种技术,用于在Web浏览器中安全执行x86程序。
>
> > (这个特殊的工具链将合并到Go 1.3的核心中。要了解更多信息,请阅读设计文档。如果您想在那之前尝试NaCl,可以查看一个包含所有更改的分支。)
>
> 请参阅Go 1.3 NACL分支。
英文:
The NaCL is (again) supported since Go 1.3.
Obsolete answer as of Go 1.2:
> The NaCl will be supported in Go 1.3 reportedly:
>
> Quote from Go 1.3 Native Client Support document:
> > Go 1.3 will include support for running command-line programs under
> > Native Client, Google’s SFI-based execution sandbox.
>
> Quote from Inside the Go Playground Go Blog:
> > Native Client (or "NaCl"), a technology developed by Google to permit the safe execution of x86 programs inside web browsers.
>
> > (This special tool chain will be merged into the core for Go 1.3. To learn more, read the design document. If you want to play with NaCl before then, you can check out a fork that has all the changes.)
>
> See Go 1.3 NACL fork.
答案4
得分: 5
如果您下载了NaCl工具链,您将会看到:
$ ls toolchain/linux_x86/bin
i686-nacl-addr2line i686-nacl-objcopy x86_64-nacl-gcc-4.4.3
i686-nacl-ar i686-nacl-objdump x86_64-nacl-gccbug
i686-nacl-as i686-nacl-ranlib x86_64-nacl-gcov
i686-nacl-c++ i686-nacl-readelf x86_64-nacl-gfortran
i686-nacl-c++filt i686-nacl-size x86_64-nacl-gprof
i686-nacl-cpp i686-nacl-strings x86_64-nacl-ld
i686-nacl-g++ i686-nacl-strip x86_64-nacl-nm
i686-nacl-gcc x86_64-nacl-addr2line x86_64-nacl-objcopy
i686-nacl-gcc-4.4.3 x86_64-nacl-ar x86_64-nacl-objdump
i686-nacl-gccbug x86_64-nacl-as x86_64-nacl-ranlib
i686-nacl-gcov x86_64-nacl-c++ x86_64-nacl-readelf
i686-nacl-gfortran x86_64-nacl-c++filt x86_64-nacl-size
i686-nacl-gprof x86_64-nacl-cpp x86_64-nacl-strings
i686-nacl-ld x86_64-nacl-g++ x86_64-nacl-strip
i686-nacl-nm x86_64-nacl-gcc
请注意,gfortran已经存在。同样,支持mono(请参阅https://github.com/elijahtaylor/mono),因此任何.net语言原则上也是可行的。Unity3d游戏引擎框架使用C#和mono,并导出到NativeClient。
英文:
if you download the NaCl toolchain, you'll see:
$ ls toolchain/linux_x86/bin
i686-nacl-addr2line i686-nacl-objcopy x86_64-nacl-gcc-4.4.3
i686-nacl-ar i686-nacl-objdump x86_64-nacl-gccbug
i686-nacl-as i686-nacl-ranlib x86_64-nacl-gcov
i686-nacl-c++ i686-nacl-readelf x86_64-nacl-gfortran
i686-nacl-c++filt i686-nacl-size x86_64-nacl-gprof
i686-nacl-cpp i686-nacl-strings x86_64-nacl-ld
i686-nacl-g++ i686-nacl-strip x86_64-nacl-nm
i686-nacl-gcc x86_64-nacl-addr2line x86_64-nacl-objcopy
i686-nacl-gcc-4.4.3 x86_64-nacl-ar x86_64-nacl-objdump
i686-nacl-gccbug x86_64-nacl-as x86_64-nacl-ranlib
i686-nacl-gcov x86_64-nacl-c++ x86_64-nacl-readelf
i686-nacl-gfortran x86_64-nacl-c++filt x86_64-nacl-size
i686-nacl-gprof x86_64-nacl-cpp x86_64-nacl-strings
i686-nacl-ld x86_64-nacl-g++ x86_64-nacl-strip
i686-nacl-nm x86_64-nacl-gcc
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论