avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject RE: [RT (was: OT)] .Net better than Java in some ways
Date Mon, 12 May 2003 10:08:14 GMT


> From: news [mailto:news@main.gmane.org] On Behalf Of Leo Simons
> 
> It seems what you 
> have here is a language extension optimizing the code structure with 
> regard to one or two particular aspects/problem spaces, which 
> in the end results in (nearly) identical bytecode. Right?

Yes.

> would it not be easier/cleaner to have the parser output 
> bytecode rather 
> than sourcecode and short-circuit the java compiler?

Then you have to implement all the compile-time optimizations 
of Sun's javac. For example, suppose you have the statement:

  int x = 3 + 4;

You want the compiler to output the equivalent bytecode of:

  int x = 7;

I.e. "constant folding". There's a ton of these things that gets
stuffed into compilers, and I'm afraid we'd end up re-implementing
them if you output bytecode directly.

I'd like to use the existing javac compiler whenever possible.

> > Anyway, what the above would allow one to use Java as a base and
> > create doman-specific extensions as needed.
> 
> potentially really neat. Any idea where/how/if avalon fits in?

    MyComponent comp = null;
    MyOtherComponent otherComp = null;
    try {
        comp = (MyComponent) manager.lookup (MyComponent.ROLE);
        otherComp = (MyOtherComponent) manager.lookup
(MyOtherComponent.ROLE);

        comp.method (parameter);
        ....
    } finally {
        manager.release (comp);
        manager.release (otherComp);
    }
 
     --->

    using (manager; MyComponent comp, MyOtherComponent otherComp) {
        comp.method (parameter);
        ....
    }

or for you Phoenix people:

    using (manager; 
           MyComponent comp ("my-role"), 
           MyOtherComponent otherComp ("my-other-role")) {

        comp.method (parameter);
        ....

    }

?

> [1] - 
> http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/9i
_sqlj/SQLJWithBC4JSample/Readme.html

Interesting. Thanks.

/LS


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Mime
View raw message