Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Camlp4] Quotation expander with OCaml syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-07-27 (14:38)
From: Raphael Proust <raphlalou@g...>
Subject: Re: [Caml-list] [Camlp4] Quotation expander with OCaml syntax
On Tue, Jul 27, 2010 at 3:22 PM,  <> wrote:
> Are you trying to the same thing as HOP [1] ?

I haven't looked at HOP yet, but I heard a lot and will probably try to read
about it in the future.

> What kind of restrictions do you impose on the expressions you can
> transfer from the server to the client (only non-functional values) ? How
> do you ensure them in your program ?

We try to minimize restriction by providing users a way to define their own
[un]wrappers for exotic values. Such a value is (1) wrapped, (2) marshalled, (3)
sent to the client, (4) unmarshalled and (5) unwrapped. It is not possible to
send a value that has no associated wrapper (but their a basic wrapper for
generic values). The "weirder" type we currently support is probably ['a

Types are currently checked (and inferred) via the wrap and unwrap function.

> Are you sure splitting the code into two parts is sufficient ? How will
> you handle branching than you can decide only at runtime, as example ? HOP
> is using a javascrip compiler embedded in a library to compile efficiently
> the right client code at runtime.

The client code is obtained with js_of_ocaml[2], an ocaml byte-code to
Javascript compiler. Code is compiled statically. Branching is handled by the
client at runtime.

> Btw, would be glad to have more details on what you have done and plan to
> do as I am working on similar things (not very actively currently) : I've
> been trying  to make camloo, a caml-light to bigloo compiler, working
> again (current version[2] is quite working - still few things to finish).
> At one point, the goal would be to extand the source language with similar
> constructs than yours  and to compile to HOP ...