

 	NaCl/OCaml (OCaml as a client-side web programming language) - budu
http://caml.inria.fr/pub/ml-archives/caml-list/2010/03/871885ab916b2207234d2874c288f3e3.en.html

======
gecko
I'm very excited to see this. OCaml is a really pleasant language to work in.
It's certainly not without its warts, but it's surprisingly easy to write
mostly-functional code that's highly performant, expressive, and easy-to-read.
I've actually been enjoying picking it back up again, this time trying to
learn it "for real", and knowing I have an interesting environment to target
makes it much more exciting.

------
dons
Should work for any native code compiler, if I'm reading this right, just have
to stay within what can be validated.

I think there's a very good chance of a GSoC project to modify Haskell/GHC's
backend to work too:
[http://www.reddit.com/r/haskell_proposals/comments/b9oym/run...](http://www.reddit.com/r/haskell_proposals/comments/b9oym/run_haskell_code_under_googles_native_client/)

------
lunchbox
I've found technical descriptions of NaCl, but still don't get what it would
look like in practice. Does NaCl enable languages like OCaml to be used
instead of JavaScript to manipulate HTML pages? Or is it like Silverlight,
which has its own non-HTML UI widget library and runs within the browser? Or
would it run outside of the browser entirely?

~~~
gecko
NaCl is a way to run native x86 instructions in a secure manner inside the
browser. As such, it has more in common with Silverlight than JavaScript. The
difference between NaCl and Silverlight is that you can use any language with
NaCl, provided that it compiles to a verifiable subset of x86. The downside,
obviously, is that while Silverlight runs just fine on any platform with a
CLR, which in practice means desktops and Zunes, NaCl only runs on x86 systems
that have the NaCl plugin installed, which currently means the dev channel of
Chrome.

As such, I view NaCl more as a research project right now than anything else,
but who knows? If Chrome OS takes off, NaCl would suddenly be a very serious
target, even if no other browsers endorse it. Meanwhile, it's still fun to
tinker with.

~~~
lunchbox
Thanks Gecko. What about UI? With Silverlight, one would write XAML to define
a webapp's UI elements (e.g. forms). Is there a NaCl equivalent? (Please
excuse my rudimentary knowledge of how things work under the hood.)

~~~
gecko
NaCl can talk to the DOM/JavaScript, or can draw things itself using a frame
buffer. All demos I've seen use the latter technique.

As far as I know, there are currently no standard widgets.
[http://nativeclient.googlecode.com/svn/data/docs_tarball/nac...](http://nativeclient.googlecode.com/svn/data/docs_tarball/nacl/googleclient/native_client/scons-
out/doc/html/index.html) has a good overview of the APIs available. I had
_thought_ that at least a little OpenGL was available as well, though I don't
see it enumerated there. I'm unsure whether that's because I'm wrong, or
because it's simply not in the generated documentation. At any rate, given
that the API is based around framebuffers, it'd be pretty easy to port GDK or
a similar system to run in NaCl.

------
sketerpot
Hopefully once they get ARM-NaCl working, they'll be able to stick it on all
the Android phones. It could actually take off.

------
malkia
Joh Harrop is a great guy, if you religiously like ocaml or F#. A True
Missionary!

