I'm pleased to announce the initial release of NaCl/OCaml, a version of the native-code OCaml compiler whose output can be validated as safe to run over the web. Together with the "Native Client" plug-in under development at Google, this means that OCaml can now be used for client-side web programming!
I hope to post more documentation, but in a nutshell:
standard library: Yes, but file operations are typically unavailable at the NaCl level and will fail.
Str (and Num): I haven't included these yet, but I intend to.
Unix: Similar capabilities are provided by the "Service" library instead. This seemed slightly more in keeping with the NaCl underpinnings than hacking Unix into submission.
Third party OCaml modules should be compilable and usable, just use "nacl-ocamlopt" in place of "ocamlopt". Of course complex libraries may present complications in practice (e.g. if they try to access the filesystem).
C bindings: it should be possible to interface with C code as per the OCaml manual, again substituting "nacl-ocamlopt" for "ocamlopt". The NaCl-specific libraries that are included (such as "Multimedia") provide a template that can be emulated.
> Maybe this is more a question about native client but could you > elaborate on the kind of constraints nacl puts on the client code. > Which libraries can be used ? The standard library ? str.cmxa ? > unix.cmxa ? Third party pure caml modules ? C bindings ? etc.
> I'm pleased to announce the initial release of NaCl/OCaml, a version > of the native-code OCaml compiler whose output can be validated as > safe to run over the web. Together with the "Native Client" plug-in > under development at Google, this means that OCaml can now be used for > client-side web programming!
> Feedback is welcome and appreciated. Please feel free to email me, > report bugs at the project website, or email > nacl-ocaml-discuss@googlegroups.com.
Very interesting! We will try to make Eliom Client (the client side programming framework for Ocsigen) work on it.
A summary of solutions to use Ocaml for client side programming: - OcamlJs (by Jake Donham): compiler OCaml -> JS - O'Browser (by Benjamin Canou): Ocaml virtual machine written in JS - NaCl/Ocaml: native code! (but requires Native client to be installed and only x86 for now) - and there may also be a compiler Ocaml bytecode -> JS soon ;-)
> I'm pleased to announce the initial release of NaCl/OCaml, a version > of the native-code OCaml compiler whose output can be validated as > safe to run over the web. Together with the "Native Client" plug-in > under development at Google, this means that OCaml can now be used for > client-side web programming!
> Feedback is welcome and appreciated. Please feel free to email me, > report bugs at the project website, or email > nacl-ocaml-discuss@googlegroups.com.