OCaml compiler for NaCl

bearophile bearophileHUGS at lycos.com
Fri Mar 5 04:33:42 PST 2010


Today the ability to run a language on a browser is important, it gives a much higher visibility to a language.

It seems they have written a patch for the OCaml compiler, allowing the binaries it produces to run on Google Native Client (NaCl):
http://caml.inria.fr/pub/ml-archives/caml-list/2010/03/871885ab916b2207234d2874c288f3e3.en.html

The patch, NaCl is a bit like a little operating system, you create a NaCl binary for a CPU (like x86), and then it runs on Linux, Mac, Windows browsers:
http://nacl-ocaml.googlecode.com/svn/trunk/ocaml-3.11.2.patch

Today NaCl is not diffused yet because Google is still trying to make it safe, I don't know when they will think it's safe enough. Eventually it will be released as built-in in Chrome (with the 3D plug-in too) and as plug-in for Firefox. At that point having a way to run D code on such plug-in will be nice, a way to give visibility to D (but today lot of people don't like to install plug-ins, that's why Crome will have it built-in). Maybe Google will encourage to use the Go language on the NaCl system.

Time ago I have adapted&compiled few small C programs for NaCl, I've seen a performance reduction of only about 5%, this is usually much less than the performance difference between DMD and LDC. So it's good enough.

Bye,
bearophile



More information about the Digitalmars-d mailing list