Java Source and NetRexx (-comments bug)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Java Source and NetRexx (-comments bug)

serkom
Dear NetRexxers,

I would like to share some thoughs concerning integration of Java Source in NetRexx projects. One might like
it or not, but Java source is a standard and every book and magazin covers it. I have not seen the word
NetRexx in a german computer magzin yet :=(. I am deeply conviced, that programming in NetRexx is the best
way to create Java classes to run in a JVM, but often you need Java Source for the not-NetRexx-folks etc.

I think, it would help to spread NetRexx if NetRexx would produce not only binary classes, but (perfect) java
source code. The NetRexx compiler does this almost, by using the options "-nocompile and -format". This
creates a java file, that one can feed into the javac compiler to obtain classes.

This created java source is understandable but not nice to read, even more when you do not know NetRexx
internals. It is sometimes usefull to create NetRexx progs, which do not use NetRexx runtime classes. Using
options binary, no say, avoid some operators etc one can achiev this, also I would personally like this to be
integrated somehow to find out, wether a runtime class and the java source will need or contain NetRexx
elements.

For my NetRexx written SurfCompanion (the SucoServlets especially), I would like to have e.g. Servlet.nrx and
create Servlet.java (and Servlet.html nrxdoc) from it. Doing this by hand ("-nocompile -format -comments") i
found some minor problems with the -comments option. It does not always preseve lines and form of
comments (e.g. if you have a box of * around it). DynaPage.nrx in /SucoServlets of the suco distribution is
such an example, where the comment in the DynaPage.java slipped to a wrong line and some bounding
comment is misformed.

I currently use NetRexx's java output and "beautify" it by hand:
a) using import statements and short classnames
b) correcting comments
c) take of some loop marks and parathesis
d) rename $vars
e) etc

Now my actual question. What has to be done (by a separate pass outside of NetRexx) to beautify
NetRexx-Java into pur Java source to give away. What can be done by a program, what has to be done by
hand. I think of write such a translator ...

And I also see a (raw) Syntax converter from pur Java Source to NetRexx source as very usefull. Take a Java
sample demonstartion give it to the converter and obtain a raw NetRexx source. Even if you have to opimize
this source afterwards would be a great help. This pretty much has been done already by the Document
converter by Dion Gillert (converting API from Java to NetRexx syntax).

Final statement:
if one could easily switch form NetRexx to Java syntax and back this would help to gain popularity of NetRexx,
as the better way of dealing with Java.


Kai Schmidt

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: Java Source and NetRexx (-comments bug)

mcbrides
>Dear NetRexxers,
>
>I would like to share some thoughs concerning integration of Java Source in NetRexx projects. One might like
>it or not, but Java source is a standard and every book and magazin covers it. I have not seen the word
>NetRexx in a german computer magzin yet :=(. I am deeply conviced, that programming in NetRexx is the best
>way to create Java classes to run in a JVM, but often you need Java Source for the not-NetRexx-folks etc.
>

I agree with this 100% (hmmm). It's happend to me over and over when showing a
bit of program to someone that he/she asks, "What is this..." and rather than
explaining my programming sample, I end up explaining NetRexx... Which isn't so
bad, but I do have to be productive at my job site.

>I think, it would help to spread NetRexx if NetRexx would produce not only binary classes, but (perfect) java
>source code. The NetRexx compiler does this almost, by using the options "-nocompile and -format". This
>creates a java file, that one can feed into the javac compiler to obtain classes.
>

This is one of the best suggestions that I've read in this news group. Being
able to show java source to an un-enlightened programmer would save quite a bit
of time... <G>

--- clip ---

>I currently use NetRexx's java output and "beautify" it by hand:

Yipes!

>a) using import statements and short classnames
>b) correcting comments
>c) take of some loop marks and parathesis
>d) rename $vars
>e) etc
>
>Now my actual question. What has to be done (by a separate pass outside of NetRexx) to beautify
>NetRexx-Java into pur Java source to give away. What can be done by a program, what has to be done by
>hand. I think of write such a translator ...
>

Make a great project, say what?

>And I also see a (raw) Syntax converter from pur Java Source to NetRexx source as very usefull. Take a Java
>sample demonstartion give it to the converter and obtain a raw NetRexx source. Even if you have to opimize
>this source afterwards would be a great help. This pretty much has been done already by the Document
>converter by Dion Gillert (converting API from Java to NetRexx syntax).
>

Again, a great project. The shameful fact is though... where is the time to implement them?

>Final statement:
>if one could easily switch form NetRexx to Java syntax and back this would help to gain popularity of NetRexx,
>as the better way of dealing with Java.
>

Filters have been around for ages, but none so desired as you propose.  It'd be
very interesting to toss a collection of java into a filter and get netrexx as
output... Hmmm... when's my next vacation...

--

/-------------------------------------\
| Jerry McBride                       |
|                                     |
|                ([hidden email]  |
\-------------------------------------/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: Java Source and NetRexx (-comments bug)

dIon Gillard/Multitask Consulting/AU
Believe it or not, in the VisualNetRexx for Java project (earlier version of
VNR), we had a NetRexx to java conversion as well as the java to NetRexx (part
of the DocConverter) I also posted a CMD file for OS/2 users to convert javap
output to NetRexx....

A post compile filter sounds like a good idea...

Jerry McBride wrote:

>
> >Dear NetRexxers,
> >
> >I would like to share some thoughs concerning integration of Java Source in NetRexx projects. One might like
> >it or not, but Java source is a standard and every book and magazin covers it. I have not seen the word
> >NetRexx in a german computer magzin yet :=(. I am deeply conviced, that programming in NetRexx is the best
> >way to create Java classes to run in a JVM, but often you need Java Source for the not-NetRexx-folks etc.
> >
>
> I agree with this 100% (hmmm). It's happend to me over and over when showing a
> bit of program to someone that he/she asks, "What is this..." and rather than
> explaining my programming sample, I end up explaining NetRexx... Which isn't so
> bad, but I do have to be productive at my job site.
>
> >I think, it would help to spread NetRexx if NetRexx would produce not only binary classes, but (perfect) java
> >source code. The NetRexx compiler does this almost, by using the options "-nocompile and -format". This
> >creates a java file, that one can feed into the javac compiler to obtain classes.
> >
>
> This is one of the best suggestions that I've read in this news group. Being
> able to show java source to an un-enlightened programmer would save quite a bit
> of time... <G>
>
> --- clip ---
>
> >I currently use NetRexx's java output and "beautify" it by hand:
>
> Yipes!
>
> >a) using import statements and short classnames
> >b) correcting comments
> >c) take of some loop marks and parathesis
> >d) rename $vars
> >e) etc
> >
> >Now my actual question. What has to be done (by a separate pass outside of NetRexx) to beautify
> >NetRexx-Java into pur Java source to give away. What can be done by a program, what has to be done by
> >hand. I think of write such a translator ...
> >
>
> Make a great project, say what?
>
> >And I also see a (raw) Syntax converter from pur Java Source to NetRexx source as very usefull. Take a Java
> >sample demonstartion give it to the converter and obtain a raw NetRexx source. Even if you have to opimize
> >this source afterwards would be a great help. This pretty much has been done already by the Document
> >converter by Dion Gillert (converting API from Java to NetRexx syntax).
> >
>
> Again, a great project. The shameful fact is though... where is the time to implement them?
>
> >Final statement:
> >if one could easily switch form NetRexx to Java syntax and back this would help to gain popularity of NetRexx,
> >as the better way of dealing with Java.
> >
>
> Filters have been around for ages, but none so desired as you propose.  It'd be
> very interesting to toss a collection of java into a filter and get netrexx as
> output... Hmmm... when's my next vacation...
>
> --
>
> /-------------------------------------\
> | Jerry McBride                       |
> |                                     |
> |                ([hidden email]  |
> \-------------------------------------/
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
> [hidden email]
> with the following message in the body of the note
> unsubscribe ibm-netrexx <e-mail address>
--
dIon Gillard
Sun Certified Java 1.1 Programmer
Work: http://www.multitask.com.au/
NetRexx: http://www.multitask.com.au/netrexx/
VisualNetRexx: http://www.trongus.com/VisualNetRexx/

vcard.vcf (336 bytes) Download Attachment