Java 9 ... the new Modula?

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

Re: Java 9 ... the new Modula?

ThSITC
It's probably too verbose, but a good way to get the result and the
remainder in one operation ;-)

In NetRexx it *could be*:  WS_C = WS_A/WS_B, remainder WS_D
Thomas.
==================================================================================
Am 20/05/2015 um 17:39 schrieb René Jansen:

> Well for some reason I never was happy with DIVIDE WS-A INTO WS-B GIVING WS-C REMAINDER WS-D.
>
> René.
>
>> In fact I always thought that
>>
>>   a=expression
>>
>> was rather odd syntax: one has to skip past the '=', read/evaluate the
>> expression, then reset back to the beginning of the line to find out what to
>> do with the result ...
>>
>> Mike
>>
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email]
>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Thomas Schneider, Vienna, Austria (Europe) :-)

www.thsitc.com
www.db-123.com
Reply | Threaded
Open this post in threaded view
|

Re: Java 9 ... the new Modula?

rvjansen
In reply to this post by Kermit Kiser
Kermit, 

I am not really sure if this is the responsibility of the IDE or build system (make, ant, gradle, maven, cmake …). This is what I mean:

Given two classes, A and B:

Fifi:dependencies rvjansen$ cat *.nrx
class A

b_prop = B()

method toString() returns String
return 'I am A'

method main(args=String[]) static

 

class B

a_prop = A()

method toString() returns String
return 'I am B'


Compile class A separately:

Program A.nrx
  === class A ===
 3 +++ b_prop = B()
   +++          ^
   +++ Error: The method 'B()' cannot be found in class 'A' or a superclass
Compilation of 'A.nrx' failed [one error]

This fails because it does not see B.class

Compile them together:

Fifi:dependencies rvjansen$ nrc A B -replace -keepasjava
NetRexx portable processor 3.04 RC1 build 179-20150518-1900
Copyright (c) RexxLA, 2011,2015.   All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program A.nrx
  === class A ===
    method toString
      overrides Object.toString
    function main(String[])
Program B.nrx
  === class B ===
    method toString
      overrides Object.toString
    function main(String[])
Compilation of 'A.nrx' successful
Compilation of 'B.nrx' successful

This goes well, as expected. We generated java source to make the next point.
Now remove the class files and compile A.java with javac:

Fifi:dependencies rvjansen$ rm *class
Fifi:dependencies rvjansen$ ls
A.java A.nrx B.java B.nrx
Fifi:dependencies rvjansen$ javac A.java
Fifi:dependencies rvjansen$ ls
A.class A.java A.nrx B.class B.java B.nrx


This gives no response, as javac so informatively tells us that all is well, but we have two class files. My conclusion is that javac concluded we needed a B.class, noticed we had a B.java in this directory and compiled it for us. It is my opinion that, in short, this is one of the reasons that people using Java complain about NetRexx and the number of dependencies they have to solve. And this is no javac-only behavior, because ecj does the same thing. The question is, do we want this, and would it be hard to implement?

best regards,

René.



On 21 mei 2015, at 00:47, Kermit Kiser <[hidden email]> wrote:

As for the dependency issue, it seems to me like an IDE should handle compile time dependency while Java 9 more addresses run time dependency if I understand it at all (probably not ;-)>



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Java 9 ... the new Modula?

Dave Woodman
In reply to this post by billfen

Bill commented:-

 

I think Java is looking at the kitchen sink for inclusion, and it's a questionable trend.  Compile time scope annotations have merit, but I think that run time scope annotations may create more problems than added value.  It may be too easy for the use of user defined meta-data to get out of control. 

 

If we wish to keep the purpose if NetRexx to be that of being an “easier Java” then I think that we do need to do the runtime side too. Should it be decided that NetRexx is an easier way to use other people’s Java then we could possibly stick to a compile-time only implementation, but we run the risk of never being quite relevant enough to tempt Java, or would-be Java coders into the fold.

 

As for “out of control” – Bill I am with you there, but, looking about I feel that it is too late. Many notable – and potentially useful – Java products have already gone down the meta-data route to extremis. Failure to keep pace with this stuff locks it away from our use.

 

Remarking on Kermit’s question of what Java 9 feature I would like to see first, I say the 1.5 and 1.6 changes above all else. Annotations and enums are preventing me from doing what I want to do in NetRexx today – the Java 9 features are not causing me pain, and, for now, neither are the Java 8 ones.

 

                Dave.




Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Java 9 ... the new Modula?

Kermit Kiser
In reply to this post by rvjansen
Hi René --

Not being a Java programmer I did not realize that javac does that! Apparently the Java "classpath" is also a "sourcepath" by default.

I am not a good person to ask if that behavior is desirable as I drive "stick-shift" cars (aka manual transmission autos) because I don't easily trust anyone else to decide for me what I need. And as for the difficulty of implementing such behavior, I would not hazard even a "ball-park" estimate without substantial research and thought!

-- Kermit

On 5/22/2015 5:51 AM, René Jansen wrote:
Kermit, 

I am not really sure if this is the responsibility of the IDE or build system (make, ant, gradle, maven, cmake …). This is what I mean:

Given two classes, A and B:

Fifi:dependencies rvjansen$ cat *.nrx
class A

b_prop = B()

method toString() returns String
return 'I am A'

method main(args=String[]) static

 

class B

a_prop = A()

method toString() returns String
return 'I am B'


Compile class A separately:

Program A.nrx
  === class A ===
 3 +++ b_prop = B()
   +++          ^
   +++ Error: The method 'B()' cannot be found in class 'A' or a superclass
Compilation of 'A.nrx' failed [one error]

This fails because it does not see B.class

Compile them together:

Fifi:dependencies rvjansen$ nrc A B -replace -keepasjava
NetRexx portable processor 3.04 RC1 build 179-20150518-1900
Copyright (c) RexxLA, 2011,2015.   All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program A.nrx
  === class A ===
    method toString
      overrides Object.toString
    function main(String[])
Program B.nrx
  === class B ===
    method toString
      overrides Object.toString
    function main(String[])
Compilation of 'A.nrx' successful
Compilation of 'B.nrx' successful

This goes well, as expected. We generated java source to make the next point.
Now remove the class files and compile A.java with javac:

Fifi:dependencies rvjansen$ rm *class
Fifi:dependencies rvjansen$ ls
A.java A.nrx B.java B.nrx
Fifi:dependencies rvjansen$ javac A.java
Fifi:dependencies rvjansen$ ls
A.class A.java A.nrx B.class B.java B.nrx


This gives no response, as javac so informatively tells us that all is well, but we have two class files. My conclusion is that javac concluded we needed a B.class, noticed we had a B.java in this directory and compiled it for us. It is my opinion that, in short, this is one of the reasons that people using Java complain about NetRexx and the number of dependencies they have to solve. And this is no javac-only behavior, because ecj does the same thing. The question is, do we want this, and would it be hard to implement?

best regards,

René.



On 21 mei 2015, at 00:47, Kermit Kiser <[hidden email]> wrote:

As for the dependency issue, it seems to me like an IDE should handle compile time dependency while Java 9 more addresses run time dependency if I understand it at all (probably not ;-)>




_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

12