On Saturday 15 July 2006 18:06, Charles O Nutter wrote:

<snip>

> Unlike Java, where you have to spit out a whole class at once, Ruby really
> just consists of "method bags". A given class is little more than pointers
> to code that understand how to manipulate that class's instance's state and
> call other methods. 

I love this view of Ruby.


<snip>

> The compiler I'm working on at present is a full-on Java bytecode compiler
> using ASM. An AST visitor traverses the tree and generates Java bytecodes
> for each type of node. The resulting code looks, in general, like what we
> implement for builtin methods written in Java by hand. There will be a
> large number of methods that should be 100% compilable by this compiler,
> and by compiling they'll escape all the overhead of interpretation.
> However, I don't yet have a good strategy for instantiating blocks, since
> in Java no method's code can access the state of another method's code.
> This compiler is also fairly dependent on the current method-call and
> variable-scoping semantics, which are slated for redesign. 

Think anonymous classes.  Of course, these are not REALLY accessing the state, 
but they create the illusion, and if they can do it, you can do it.

David


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to