Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Execute rebol from java

From: arolls:idatam:au at: 9-Jan-2002 13:09

Hi Volker,
> Hi Anton > darkly remembering a demo which added some demo-syntax to java, > outputting "clean java". > done with a tool packed with javacc called jjtree and a > grammar for java.
It's all far too complicated!! ;) They seem very useful so I'll have to check them out some more.
> then there is scheme and python both compiling to java-bytecode. > And Freebell on the FX5 -site. Maybe you can motivate > Frank Sievertsen & RT to allow it / make it usable?
I just checked out Freebell. It looks very promising. Go Frank.
> > So I am thinking I will make a java class to output a > > ..java file, then javac it, and run the new class with > > Class.forName("new.class");. > > I would prefer to do this in memory somehow, too. > > And if someone else has done this already, or if javac > > can help this kind of thing.
I nearly finished a working version yesterday. It's missing the compile stage, at the moment, out of the steps: compose, save, compile, run. The rest works ok. (It won't be hard to do.)
> hum. you need javac internal for speed and ClassLoader > to allow for multiple classes of the same name > (like multiple times the same applet loaded). > if i now could remember where i have that prototype stuff, > and how to use/configure.. ;-)
These enhancements would really make it look good. I am interested...
> > This isn't /really/ important... I just won't feel > > 100% healthy programming in java until I can do composed > > code like rebol can... :) > > Well, then it needs smarter syntax .I prefer the original. *g* > But if you need to use/learn java, its a funny way. > specially if the composing can be done with > Runtime.exec(uting) rebol :)
That's a good idea! But how to keep it all in one file? Can a java class know where its source file is located? Then I could embed the java code in multi-line comments, which would be better than the messy way I am currently using (array of strings - see code link below.)
> > Of course, once I have a class that can execute > > composed java code (in a clean, simple way), I will be > > so much more powerful. ;) > > Hm, feedback to polish it? > on or off list? the composing part here? ;-)
Hmm. As long as it has /something/ to do with rebol. I have to say that my experience composing with rebol is the main reason why I would try something like this. Without that experience, I doubt I would have realised how useful composing can be. I will keep the code off the list unless it contains some rebol though. The code is accessible at the bottom of this page: http://anton.idatam.com.au/index.html
> -Volker
Anton.