20

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

Richard J. Ross III
  • 55,009
  • 24
  • 135
  • 201
Alexis
  • 23,545
  • 19
  • 104
  • 143

4 Answers4

8

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.

Brad Fitzpatrick
  • 3,551
  • 1
  • 19
  • 9
6

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.

Vojtech Vitek - golang.cz
  • 25,275
  • 4
  • 34
  • 40
6

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

gkuan
  • 921
  • 6
  • 6
  • 1
    There are a few Python-to-JavaScript compilers if written browser apps in Python is what you are interested in. http://pyjs.org/ – gkuan Oct 17 '11 at 23:24
5

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.

Bennet Yee
  • 506
  • 2
  • 6