On 2/3/23 17:19, René Jansen wrote:
Time for a new pc, I think. I installed numpy (which did not came standard) and 
I got

I'm getting a m2 MacBook Pro (12-30) soon so I'll run it again and let you know.


➜  solution_3 git:(drag-race) ✗ python3 PrimePY.py
Passes: 11241, Time: 5.000303332984913, Avg: 0.00044482726919179013, Limit: 
1000000, Count: 78498, Valid: True

and speaking about ooRexx, on my daily machine, which is a glorified iPhone (a 
Mac Mini with the first m1 SOC) it runs 117 iterations instead of the 3 you 
reported. I’ll profile that later and will let the team know.

One look at the NetRexx solution gave me this (with one small change):

➜  solution_2 git:(drag-race) ✗ java PrimeNetRexx
joss_NetRexx;15686;5.000054;1;algorithm=base,bits=8,faithful=yes

I’ll submit that as PrimeRexx solution_3 later today; I only changed the 
SquareRoot method to that from the JDK because there is no reason to do that 
with variable precision if you are going to trunc the result to int. There 
might be more to do, but I am rather pleased with this result already.

That shouldn't make any difference. SquareRoot is only called once. I had to laugh when I noticed that it was implemented using Newton–Raphson in REXX. How can a programming language not implement a sqrt() function?



I had a look at Kotlin. To build that example, I needed to download and install 
Gradle. Started compile.sh, this downloaded hundreds of megabytes, and then 
failed.
If I compare that to NetRexx:

nrc PrimeNetRexx

How do I build NetRexx programs using Gradle or Maven! It kind of sucks having to rub two sticks together using the command line!



with (sorry!) a CLASSPATH of .:NetRexxC.jar - I am not really convinced that we 
are that user unfriendly. Of course I will look into having a CLASSPATH env 
variable set in one of the scripts, but the moment the user includes something 
from another jar - they have to set a CLASSPATH anyway.

As Rony has shown, someone with mainframe experience could easily write bog 
standard Rexx and, when the performance is really needed, do a slight detour 
through NetRexx (with the added advantage that the NetRexx stays easy and 
understandable). As Colin said, we are not sieving primes all day.

I think 99% of the folks on this forum want a language that can run in a TSO/ISPF environment hosted in PDS data sets. Lua can do that and it's orders of magnitudes faster then REXX with the advantage of package management. The next gen guys don't use TSO/ISPF and they're going to use Python and couldn't give a hoot about NetRexx.



I am interested in having a place to analyse Z arch vector instructions and DFP 
usage by compilers, also for an upcoming Rexx compiler for 64 bits. Would 
someone have such a place? I am reluctant to drive my customers lpars through 
the roof due to capping and tariffs (although slightly related to my work 
there). It would be open source, so there is no financial gain attached.

best regards,

René.


On 2 Mar 2023, at 05:24, David Crayford <dcrayf...@gmail.com> wrote:

After struggling with NetRexx, I've found that it could benefit from being as 
user-friendly as Kotlin or Groovy if the maintainers want to attract more 
users. On my machine, NetRexx is slower than Python but still respectable.

However, both Python and NetRexx are outperformed by highly optimized Java 
solutions. Go is also impressive and available on z/OS using the IBM SDK.

It's important to note that NetRexx is not ooRexx, and the discussion was 
focused on the poor performance of ooRexx. While some may choose to bridge 
NetRexx with Java, I personally find it more convenient to use Kotlin or Groovy 
instead.


❯ python3 PrimePy.py
Passes: 6699, Time: 5.000532913953066, Avg: 0.0007464596079941881, Limit: 
1000000, Count: 78498, Valid: True
emillynge_numpy; 6699;5.000532913953066;1;algorithm=base,faithful=no,bits=8

❯ java -cp ~/NetRexx-4.04-GA/lib/NetRexxF.jar:. PrimeNetRexx
joss_NetRexx;5743;5.000354;1;algorithm=base,bits=8,faithful=yes

Optimized Java

❯ ./runSolution.sh
chrvanorleI32;6197;5.000000;1;algorithm=base,faithful=yes,bits=1
chrvanorleI32;19191;5.003000;4;algorithm=base,faithful=yes,bits=1
chrvanorleI32C;7511;5.000000;1;algorithm=base,faithful=yes,bits=1
chrvanorleI32C;21451;5.003000;4;algorithm=base,faithful=yes,bits=1
chrvanorleI64;5957;5.000000;1;algorithm=base,faithful=yes,bits=1
chrvanorleI64;18471;5.015000;4;algorithm=base,faithful=yes,bits=1
chrvanorleI64C;7161;5.000000;1;algorithm=base,faithful=yes,bits=1
chrvanorleI64C;21167;5.006000;4;algorithm=base,faithful=yes,bits=1
chrvanorleI64PatternCalc;9308;5.000000;1;algorithm=other,faithful=yes,bits=1
chrvanorleI64PatternCalc;29123;5.004000;4;algorithm=other,faithful=yes,bits=1
chrvanorleI8;4946;5.000000;1;algorithm=base,faithful=yes,bits=1
chrvanorleI8;14963;5.016000;4;algorithm=base,faithful=yes,bits=1
chrvanorleI32CUnroll;7927;5.000000;1;algorithm=base,faithful=yes,bits=1
chrvanorleI32CUnroll;25650;5.006000;4;algorithm=base,faithful=yes,bits=1
chrvanorleStrided32Blocks16k;12069;5.000000;1;algorithm=base,faithful=yes,bits=1
chrvanorleStrided32Blocks16k;37190;5.009000;4;algorithm=base,faithful=yes,bits=1

❯ go run .
Run for 5.0 seconds using 12 workers to builing a sieve up to 1000000...
Passes: 19506, Time: 5000 ms, Avg: 256336 ns/op, Limit: 1000000, Count1: 78498, 
Count2: 78498, Valid: true
kpym-go-multi;19506;5.000096;4;algorithm=base,faithful=yes


On 2/3/23 00:54, René Jansen wrote:
so this should work for you:

➜  test git:(master) ✗ cat hello.nrx
import java.lang.String

say 'hello java' System.getProperty("java.version")

loop i=long 0 to 10
        hello(i)
end

loop i=long 0 to 10
        hello(java.lang.String(i))
end

method hello(j)
   say "hello" j

   method hello(j=long)
     say "hello long" j

   method hello(j=java.lang.String)
     say "hello String" j
➜  test git:(master) ✗ unset CLASSPATH
➜  test git:(master) ✗ echo $CLASSPATH

➜  test git:(master) ✗ java -jar NetRexxC.jar hello
NetRexx portable processor 4.05-beta build 374-20230213-1052
Copyright (c) RexxLA, 2011,2023.   All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program hello.nrx
     constructor hello(Rexx)
     constructor hello(long)
     constructor hello(String)
Compilation of 'hello.nrx' successful
➜  test git:(master) ✗

I have a global CLASSPATH, and only for specific projects I have a -cp on the 
command line for Make or Ninja, to have control over versions and libraries.
A global classpath enables me to check if all code is still compatible with the 
combination of releases from different libraries I use.
But as you see it is not really needed. We are not mandating anything, and if 
you want to run from a jar, that is fine.

best regards,

René.

On 1 Mar 2023, at 17:23, David Crayford<dcrayf...@gmail.com>  wrote:

On 2/3/23 00:20, René Jansen wrote:
Well, it *is* an executable jar. Up to you.
Executable Jars don't require setting a CLASSPATH Rene


On 1 Mar 2023, at 17:17, David Crayford<dcrayf...@gmail.com>  wrote:

Why doesn't it just use an executable jar and use "-jar"?
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email tolists...@listserv.ua.edu  with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email tolists...@listserv.ua.edu  with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email tolists...@listserv.ua.edu  with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to