Need help with BETA2 and pipes on OpenBSD

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

Need help with BETA2 and pipes on OpenBSD

Jason Martin
--------------from this post--------------
https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_pipes-2Dfor-2Dnetrexx-2Dexample-2D2-2Da-2Dpipe-2Dfilter-2Din-2DNetRexx-2Dtd4028287.html&d=DwIDaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=l2Kp4FWDyN5D0lUbeB9EExhyJ5CeYA77Wz6VYlZm5Ng&s=6VtPNw41jtejP_Kg_X167niIOw-Ac_zqtZp7dIONX68&e= 

-----------------.profile-----------------
CLASSPATH=$CLASSPATH:$HOME/NetRexx-3.08-BETA2/lib/NetRexxF.jar
export CLASSPATH

alias pipe="java org.netrexx.njpipes.pipes.runner"
alias pipc="java org.netrexx.njpipes.pipes.compiler"
alias nrc="java org.netrexx.process.NetRexxC"

---------------java version---------------
openjdk version "1.8.0_202"
OpenJDK Runtime Environment (build 1.8.0_202-b08)
OpenJDK 64-Bit Server VM (build 25.202-b08, mixed mode)

----------------length.nrx----------------
import org.netrexx.njpipes.pipes.

class length extends stage

method run()
   do
     loop forever
       line = rexx peekto()

       l = line.length

       output(l l.d2x line)
       readto()
     end
   catch StageError
     rc = rc()
   end
   exit(rc*(rc<>12))

-------------------pipe-------------------
pipe "(testl sep |) diskr length.nrx | length | console"
  59 +++     _s_2 = length()
     +++            ^^^^^^
     +++ Error: The method 'length()' cannot be found in class 'testl'
or a superclass
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index:
0, Size: 0
         at java.util.ArrayList.rangeCheck(ArrayList.java:657)
         at java.util.ArrayList.get(ArrayList.java:433)
         at org.netrexx.process.NetRexxC.clgMain(NetRexxC.java:134)
         at org.netrexx.njpipes.pipes.compiler.compile(compiler.java:899)
         at org.netrexx.njpipes.pipes.compiler.<init>(compiler.java:942)
         at org.netrexx.njpipes.pipes.runner.main(runner.java:48)

-------------------pipc-------------------
  pipc "(testl sep |) diskr length.nrx | length | console"
( testl sep | )  diskr length.nrx | length | console
  59 +++    _s_2 = length()
     +++           ^^^^^^
     +++ Error: The method 'length()' cannot be found in class 'testl'
or a superclass


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

Reply | Threaded
Open this post in threaded view
|

Re: Need help with BETA2 and pipes on OpenBSD

rvjansen
. In classpath for current directory?

René.

> On 6 Aug 2019, at 20:55, Jason Martin <[hidden email]> wrote:
>
> --------------from this post--------------
> https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_pipes-2Dfor-2Dnetrexx-2Dexample-2D2-2Da-2Dpipe-2Dfilter-2Din-2DNetRexx-2Dtd4028287.html&d=DwIDaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=l2Kp4FWDyN5D0lUbeB9EExhyJ5CeYA77Wz6VYlZm5Ng&s=6VtPNw41jtejP_Kg_X167niIOw-Ac_zqtZp7dIONX68&e= 
> -----------------.profile-----------------
> CLASSPATH=$CLASSPATH:$HOME/NetRexx-3.08-BETA2/lib/NetRexxF.jar
> export CLASSPATH
>
> alias pipe="java org.netrexx.njpipes.pipes.runner"
> alias pipc="java org.netrexx.njpipes.pipes.compiler"
> alias nrc="java org.netrexx.process.NetRexxC"
>
> ---------------java version---------------
> openjdk version "1.8.0_202"
> OpenJDK Runtime Environment (build 1.8.0_202-b08)
> OpenJDK 64-Bit Server VM (build 25.202-b08, mixed mode)
>
> ----------------length.nrx----------------
> import org.netrexx.njpipes.pipes.
>
> class length extends stage
>
> method run()
>   do
>     loop forever
>       line = rexx peekto()
>
>       l = line.length
>
>       output(l l.d2x line)
>       readto()
>     end
>   catch StageError
>     rc = rc()
>   end
>   exit(rc*(rc<>12))
>
> -------------------pipe-------------------
> pipe "(testl sep |) diskr length.nrx | length | console"
>  59 +++     _s_2 = length()
>     +++            ^^^^^^
>     +++ Error: The method 'length()' cannot be found in class 'testl' or a superclass
> Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>         at java.util.ArrayList.rangeCheck(ArrayList.java:657)
>         at java.util.ArrayList.get(ArrayList.java:433)
>         at org.netrexx.process.NetRexxC.clgMain(NetRexxC.java:134)
>         at org.netrexx.njpipes.pipes.compiler.compile(compiler.java:899)
>         at org.netrexx.njpipes.pipes.compiler.<init>(compiler.java:942)
>         at org.netrexx.njpipes.pipes.runner.main(runner.java:48)
>
> -------------------pipc-------------------
>  pipc "(testl sep |) diskr length.nrx | length | console"
> ( testl sep | )  diskr length.nrx | length | console
>  59 +++    _s_2 = length()
>     +++           ^^^^^^
>     +++ Error: The method 'length()' cannot be found in class 'testl' or a superclass
>
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=IGyj7UV0lBK2r3oymLbdOoFxyT_mn-pYaLreOflVJd4&s=7QQQiKQVNe3KRNPeIFwnIWy6DL0sN9t4HfzeRYA6SRo&e= 
>


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

Reply | Threaded
Open this post in threaded view
|

Re: Need help with BETA2 and pipes on OpenBSD

Jason Martin
In reply to this post by Jason Martin
export CLASSPATH=$HOME/NetRexx-3.08-BETA2/lib/NetRexxF.jar:.
echo $CLASSPATH
/home/agrellum/NetRexx-3.08-BETA2/lib/NetRexxF.jar:.

Same thing.

Will work with it some more tomorrow.

Default shell.

Did Bash too.



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

Reply | Threaded
Open this post in threaded view
|

Re: Need help with BETA2 and pipes on OpenBSD

rvjansen
ok. works here:

➜  pipes git:(master) ✗ nrc length
NetRexx portable processor 3.08-BETA2 build 1,196-20190806-1239
Copyright (c) RexxLA, 2011,2019.   All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program length.nrx
  === class length ===
    method run
      signals ThreadQ
      overrides stage.run
Compilation of 'length.nrx' successful
➜  pipes git:(master) ✗ pipe "(testl sep |) diskr length.nrx | length | console"
33 21 import org.netrexx.njpipes.pipes.
0 0
26 1A class length extends stage
2 2
14 E   method run()
6 6     do
18 12       loop forever
21 15 line = rexx peekto()
16 10 l = line.length
21 15 output(l l.d2x line)
9 9 readto()
9 9       end
20 14     catch StageError
15 F       rc = rc()
7 7     end
23 17     exit(rc*(rc<>12))

ran it on macOS, Linux and Windows, cmd and powershell and even Ubuntu on Windows Linux subsystem.

This is my classpath on Linux (that’s the shortest one):

rvjansen@ams:~/apps/netrexx-code/examples/pipes$ echo $CLASSPATH
.:/home/rvjansen/apps/netrexx-code/build/lib/NetRexxC.jar

Note that your pipe spec works, but with the latest changes it can be identical to CMS:

pipe "< length.nrx | length | console"

Thanks for testing; we’ll fix it tomorrow.

René.

On 6 Aug 2019, at 22:31, Jason Martin <[hidden email]> wrote:

export CLASSPATH=$HOME/NetRexx-3.08-BETA2/lib/NetRexxF.jar:.
echo $CLASSPATH
/home/agrellum/NetRexx-3.08-BETA2/lib/NetRexxF.jar:.

Same thing.

Will work with it some more tomorrow.

Default shell.

Did Bash too.



_______________________________________________
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/

Reply | Threaded
Open this post in threaded view
|

Re: Need help with BETA2 and pipes on OpenBSD

rvjansen
you did compile length.nrx and you have a length.class file? 
If not … that would be a whole new exercise, to pull in the source at runtime and make it part of the compilation unit.

best regards,

René.

On 6 Aug 2019, at 22:53, René Jansen <[hidden email]> wrote:

ok. works here:

➜  pipes git:(master) ✗ nrc length
NetRexx portable processor 3.08-BETA2 build 1,196-20190806-1239
Copyright (c) RexxLA, 2011,2019.   All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program length.nrx
  === class length ===
    method run
      signals ThreadQ
      overrides stage.run
Compilation of 'length.nrx' successful
➜  pipes git:(master) ✗ pipe "(testl sep |) diskr length.nrx | length | console"
33 21 import org.netrexx.njpipes.pipes.
0 0
26 1A class length extends stage
2 2
14 E   method run()
6 6     do
18 12       loop forever
21 15 line = rexx peekto()
16 10 l = line.length
21 15 output(l l.d2x line)
9 9 readto()
9 9       end
20 14     catch StageError
15 F       rc = rc()
7 7     end
23 17     exit(rc*(rc<>12))

ran it on macOS, Linux and Windows, cmd and powershell and even Ubuntu on Windows Linux subsystem.

This is my classpath on Linux (that’s the shortest one):

rvjansen@ams:~/apps/netrexx-code/examples/pipes$ echo $CLASSPATH
.:/home/rvjansen/apps/netrexx-code/build/lib/NetRexxC.jar

Note that your pipe spec works, but with the latest changes it can be identical to CMS:

pipe "< length.nrx | length | console"

Thanks for testing; we’ll fix it tomorrow.

René.

On 6 Aug 2019, at 22:31, Jason Martin <[hidden email]> wrote:

export CLASSPATH=$HOME/NetRexx-3.08-BETA2/lib/NetRexxF.jar:.
echo $CLASSPATH
/home/agrellum/NetRexx-3.08-BETA2/lib/NetRexxF.jar:.

Same thing.

Will work with it some more tomorrow.

Default shell.

Did Bash too.



_______________________________________________
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/

Reply | Threaded
Open this post in threaded view
|

Re: Need help with BETA2 and pipes on OpenBSD

Jason Martin
Did not compile it.

Thought it was all one process.

Will try that.

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

Reply | Threaded
Open this post in threaded view
|

Re: Need help with BETA2 and pipes on OpenBSD

Jason Martin
Works.

Sorry, understood it as all in one process with pipe compiler.

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

Reply | Threaded
Open this post in threaded view
|

Re: Need help with BETA2 and pipes on OpenBSD

rvjansen
Sorry for not making that clear. All stages are also class files, compiled and part of the netrexx jar. Only the glue that connects them is dynamically generated and executed, including added classes like sort that does a trivial subclass for every pipe.The classes must be there, and are reflectively loaded to check their existence before the pipe compiler wires them up. At that point we might attempt a lookup on the classpath and a compile.

I am writing docs as we speak. I’ll address the point.

best regards,

René.

> On 6 Aug 2019, at 23:02, Jason Martin <[hidden email]> wrote:
>
> Works.
>
> Sorry, understood it as all in one process with pipe compiler.
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=3xsnicZ9CVg0g42wUxZb_JvLAQ3tbNzZPLqhkRhCb04&s=rrG8mWOgpop21NX6C739pyqkueHQ7Kg3C8Dqgn7lZ0k&e= 
>


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

Reply | Threaded
Open this post in threaded view
|

Re: Need help with BETA2 and pipes on OpenBSD

rvjansen
what you can do, is the following, to integrate your own custom stage source in a pipe definition file:

rvjansen@ams:~/apps/netrexx-code/examples/pipes$ cat length1.njp
pipe (lengthp) < length.nrx | length1 | console

import org.netrexx.njpipes.pipes.

class length1 extends stage final

  method run()
    do
      loop forever
line = rexx peekto()
l = line.length
output(l l.d2x line)
readto()
      end
    catch StageError
      rc = rc()
    end
    exit(rc*(rc<>12))

compile that:

rvjansen@ams:~/apps/netrexx-code/examples/pipes$ pipc length1
pipe (lengthp ) < length.nrx | length1 | console

and run it:
rvjansen@ams:~/apps/netrexx-code/examples/pipes$ java lengthp
33 21 import org.netrexx.njpipes.pipes.
0 0
26 1A class length extends stage
2 2
14 E   method run()
6 6     do
18 12       loop forever
21 15 line = rexx peekto()
16 10 l = line.length
21 15 output(l l.d2x line)
9 9 readto()
9 9       end
20 14     catch StageError
15 F       rc = rc()
7 7     end
23 17     exit(rc*(rc<>12))

but that is how it used to work for a long time.

best regards,

René.

On 6 Aug 2019, at 23:11, René Jansen <[hidden email]> wrote:

Sorry for not making that clear. All stages are also class files, compiled and part of the netrexx jar. Only the glue that connects them is dynamically generated and executed, including added classes like sort that does a trivial subclass for every pipe.The classes must be there, and are reflectively loaded to check their existence before the pipe compiler wires them up. At that point we might attempt a lookup on the classpath and a compile.

I am writing docs as we speak. I’ll address the point.

best regards,

René.

On 6 Aug 2019, at 23:02, Jason Martin <[hidden email]> wrote:

Works.

Sorry, understood it as all in one process with pipe compiler.

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=3xsnicZ9CVg0g42wUxZb_JvLAQ3tbNzZPLqhkRhCb04&s=rrG8mWOgpop21NX6C739pyqkueHQ7Kg3C8Dqgn7lZ0k&e=



_______________________________________________
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/