[e-lang] quick look at Caja vs. GWT's output

Lex Spoon lex at lexspoon.org
Tue Jan 22 15:12:45 EST 2008

I looked over the Caja doc a few days ago, mainly at the informal  
overview at the beginning, trying to figure out if the Google Web  
Toolkit (GWT) can be modified to emit Caja.  I'm posting here,  
because it's a cross-language issue.

Background, for those needing it:
- GWT is a Java->JavaScript translator developed at Google.  You  
write Java code, and it translates it to JavaScript

- Caja is an objcaps subset of JavaScript that is also developed at  

- Joe-E is an objcaps subset of Java.

Currently these projects have no relation.  It would be neat if (1)  
GWT could emit Caja, and (2) GWT could, when given Joe-E input, could  
emit Caja that parallels the structure and security properties of the  
Joe-E input.  (more on that in a few minutes).

 From my quick read of the Caja doc, I see no fundamental problems  
with having GWT target Caja instead of arbitrary JavaScript.  In  
general, GWT is using JavaScript to simulate Java, so rules like  
"this stealing" and inheritance rules should not be a problem.

There do appear to be some non-fundamental yet time-consuming issues  
to fix up.  In particular, the naming issues are quite likely to run  
into stumbling blocks here and there, simply because GWT is not  
careful about naming right now.  Also, all fields will probably need  
to get automatic getters and setters, because GWT input is arbitrary  
Java code.

More  speculatively, GWT could also have a switch for Joe-E source  
files.  In such a mode, probably the automatic getters and setters  
would not be necessary.  That's a later project, though.  The first  
thing, it would seem, is to check whether GWT can be coaxed into  
emitting Caja at all.

To firm up this view, I would next like to run GWT's output through  
the Cajoler and see what it says.  I could not  find a pre-built  
Cajoler last Friday, so I stopped for now.  When I find another time  
slice to look at GWT -> Caja, I'll follow the instructions on the  
CajaCajole wiki page:



Lex Spoon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.eros-os.org/pipermail/e-lang/attachments/20080122/6ac67a30/attachment.html 

More information about the e-lang mailing list