[e-lang] translating one objcaps language to another?

Mark Miller erights at gmail.com
Tue Jan 22 20:20:16 EST 2008


On Jan 22, 2008 12:18 PM, Lex Spoon <lex at lexspoon.org> wrote:
> Does anyone know of a compiler that goes from one object capabilities
> language to another?

A first step is to decide on a mapping of basic Java (or Joe-E) types
to basic JavaScript (or Caja) types. Leaving security aside for the
moment, we already have at least four(!!) mappings between these two
languages:

* GWT provides a JS Native API, allowing Java code translated to
JavaScript to directly call JavaScript objects.
* Rhino allows JavaScript code to call Java objects.
* The browsers provide LiveConnect
<http://en.wikipedia.org/wiki/LiveConnect>, enabling JavaScript on a
web page to talk to Java applets on that page.
* Waterken's provides both a Java and a JavaScript ref_send API,
mapping each language onto Waterken's JSON/HTTPS-based protocol.
* Once Microsoft's CLR (.net virtual machine) supports JavaScript,
then this will create a mapping between JavaScript and J#.

I have never heard anyone comment on the compatibility between even
any two of these mappings. Can someone please comment on their
similarities and differences.

>  If you were working with such a tool, what you
> would want is to be able to reason in either the source language or
> the target language and not go wrong.  I would like to better
> understand what exactly this level-shifting means.
>
> It looks tempting to say you want object graphs in the source
> language to map to object graphs in the target language.  If the
> source language has a reference from SA to SB, then you want the
> target language to have a reference from TA to TB where TA and TB are
> the objects corresponding to SA and SB.  Given this property, it
> would seem like you could shift your reasoning between the
> compilation levels pretty safely.
>
> I am not sure, though.  What do you guys think?


I think this property is desirable but not adequate by itself.
<http://lambda-the-ultimate.org/node/1588> would seem to be relevant.


-- 
Text by me above is hereby placed in the public domain

    Cheers,
    --MarkM


More information about the e-lang mailing list