Alexis
Alexis

Reputation: 25233

Can Native Client (NaCl) programs be written in languages other than C or C++?

Would it be possible to write a native client application in Python or Go that could then run in the browser?

Upvotes: 19

Views: 4389

Answers (4)

Vojtech Vitek - golang.cz
Vojtech Vitek - golang.cz

Reputation: 27784

The NaCL is (again) supported since Go 1.3.

See Golang 1.3 release notes.


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.

Upvotes: 6

Bennet Yee
Bennet Yee

Reputation: 526

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.

Upvotes: 5

Brad Fitzpatrick
Brad Fitzpatrick

Reputation: 3591

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.

Upvotes: 8

gkuan
gkuan

Reputation: 921

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 ).

Upvotes: 6

Related Questions