OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | asm List | November 2006 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [asm] asm as a compiler?


Hi,

first, I'm very sorry I posted directly to you... That is really annoying on this list. It is the only one I have to remember, that the list is only added as CC: and that no reply-to is set. Isn't it possible to change that? Anyway...

Ville Oikarinen schrieb:
[...]
I hope you don't mind that I quote your reply so I can keep the discussion public.

no, of course not, it was my mistake.

You are right, I don't want to implement a compiler by my own. That's why
I wrote to this mailing list :)

I am fully aware of the different languages that produce bytecde (in fact
I used Groovy as a platform for my metalanguage before it grew to a
stand-alone functional language). I am not interested in them.

that wasn't ment to say to use Groovy instead of your meta language. I suggested to produce Groovy code, evaluate it using Groovy and then use the resulting class as a class of your MetaLanguage. You would still have to write a parser/lexer then. I thought that was the way you wanted to got when using Java, or not?


I am interested in generating java source, and optionally, if I get the answer I hope, classes.

as long as all of your meta language is expressable in Java... That most possibly means your language must be static typed and other things. And of course... ever thought what you do about compiletime errors? You will hae to make semantic checks oin the expressions written in your metalanguage to ensure this can't happen.


If this isn't easily achievable, then I settle for generating java source
with ant files and let ant continue from there.

There are many reasons why I want to generate java sources, and not only
bytecode directly. The most general reason is that my tool is a
metalanguage and thus it should be able to be used for any
transformations, including ones that produce java source, and others that
consume java source.

But generating java source has also other advantages:

- the users of the metalanguage can understand and debug the generated
java sources

if you don't write the files to the filesystem, then not.... They will do that for debugging then?


- the generated java sources can be published as open "source", a model
for which I don't know a better name than my own "open implementation", in
which the real source (written in the metalanguage) is closed, but the
intermediate source is open, allowing the client to verify the
implementation.

So janino and other "almost java" compilers won't do in my case.

Maybe you should take a look at the eclipse compiler. It is possible to use it outside eclipse and I think it can be used/extended to write the bytecode not to files. But I never took a close look at it, it is just a guess. And of course that compiler is complex and big.


bye blackdrag

--
Jochen "blackdrag" Theodorou
Groovy Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.