Nice! Now do CLIST
Ok, just joking. I was probably the last person on my block to switch
from CLIST to Rexx when it became available on MVS. A simple thing
finally pushed me over: I ran a small performance test and Rexx beat
CLIST by about 1000 times if I remember correctly. So I pulled out the
Rexx manuals.
On 1/10/2022 8:46 PM, David Crayford wrote:
On 10/1/22 11:15 pm, Seymour J Metz wrote:
ooRexx will never be high speed because it's implementation is
fundamentally ineffecient.
That seems to be begging the question. Certainly the current
implementation is inefficient, but what fundamental issue prevents a
more efficient implementation?
A more effecient implementation requires a rewrite.
For that matter, what fundamental issue prevents compiling into Java
bytecode with a large runtime similar to the CREXX runtime?
None. TBH, I hadn't had much of a look at NetRexx but it's promising.
It's strongly typed and the JVM is going to JIT compile it so it will be
fast. As Rene mentioned you can use Java classes so there is a massive
eco-system available.
I knocked up some simple benchtests which create an array of squares and
then find the maximum value. The maximum value is the end element. The
results are just what I expected. ooRexx performs poorly.
Stem variables are particularly bad which is to be expected because they
are essentially associative arrays. Using the Array class was much
better but the result was still many orders of magnitude worse then the
other languages I tested. What's interesting is that LuaJIT is as fast
as C++ and interpreted Lua is almost as fast as Julia which has JIT.
❯ rexx -v
Open Object Rexx Version 4.2.0
Build date: Dec 29 2013
Addressing Mode: 64
Copyright (c) IBM Corporation 1995, 2004.
Copyright (c) RexxLA 2005-2013.
All Rights Reserved.
This program and the accompanying materials are made available under
the terms of the Common Public License v1.0 which accompanies this
distribution or at
http://www.oorexx.org/license.html
❯ cat squares.rexx
/* REXX */
numeric digits 30
MAX = 10000000
s. = 0
do n = 1 to MAX
s.n = n * n
end
m = 0
do i = 1 to MAX
m = max(m, s.i)
end
say max
❯ time rexx squares.rexx
10000000rexx squares.rexx 43.04s user 3.25s system 99% cpu 46.296 total
❯ cat squares2.rexx
numeric digits 30
s = .Array~new()
do n = 1 to 10000000
s~append(n * n)
end
m = 0
do n = 1 to s~items
m = max(m, s[n])
end
say m
❯ time rexx squares2.rexx
100000000000000
rexx squares2.rexx 17.25s user 1.32s system 99% cpu 18.568 total
❯ lua -v
Lua 5.3.3 Copyright (C) 1994-2016 Lua.org, PUC-Rio
local s = {}
for n = 1, 10000000 do
s[n] = n * n
end
local max = 0
for _, n in ipairs(s) do
max = math.max(max, n)
end
print(max)
❯ time lua squares.lua
100000000000000
lua squares.lua 0.79s user 0.07s system 99% cpu 0.862 total
❯ luajit -v
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
❯ time luajit squares.lua
1e+14
luajit squares.lua 0.08s user 0.05s system 99% cpu 0.137 total
❯ python3 --version
Python 3.8.10
❯ cat squares.py
s = []
for n in range(1, 10000000+1):
s.append(n * n)
print(max(s))
❯ time python3 squares.py
100000000000000
python3 squares.py 1.13s user 0.16s system 99% cpu 1.288 total
❯ julia --version
julia version 1.4.1
❯ cat squares.jl
s = Int[]
for n = 1:10000000
push!(s, n * n)
end
println(maximum(s))
❯ time julia squares.jl
100000000000000
julia squares.jl 0.56s user 0.74s system 214% cpu 0.608 total
❯ clang++ --version
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
❯ cat squares.cpp
#include <vector>
#include <cstdint>
#include <iostream>
#include <algorithm>
int main() {
constexpr int MAX = 10000000;
std::vector<uint64_t> s(MAX);
for (uint64_t n = 1; n <= MAX; n++) s.push_back(n * n);
std::cout << *std::max_element(s.begin(), s.end()) << "\n";
❯ time ./squares
100000000000000
./squares 0.05s user 0.05s system 99% cpu 0.107 total
--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
________________________________________
From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on
behalf of David Crayford [dcrayf...@gmail.com]
Sent: Monday, January 10, 2022 8:13 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Ad message paradigm (Re: Ad NetRexx (Re: Ad programming
features (Re: ... Re: Top 8 Reasons for using Python instead of REXX
for z/OS
On 10/1/22 8:34 pm, Rony G. Flatscher wrote:
On 09.01.2022 16:29, Seymour J Metz wrote:
Well all of your languages miss the support for the message paradigm.
What do you mean by "the message paradigm"? How does it differ from
sending method invocation and response messages to objects?
The message paradigm as set forth by Smalltalk explicitly defines a
class for messages, allows for
intercepting messages, rerouting messages at the will of the
programmer and much more, as messages
themselves become objects that the programmer can interact with, if
needed.
ooRexx implements the message paradigm in full, something that is
easily overlooked as usually it is
not necessary to be aware of it.
If it's not necessary then why did you make such a big deal about it?
As you can see, if there should be need for adding external functions
and/or methods to ooRexx, this
can be done with the powerful and easy to use C++ API of ooRexx. As a
matter of fact BSF4ooRexx and
dbusoorexx are using those native C++ APIs allowing high speed and
using all that is available in
and via the C++ world.
ooRexx will never be high speed because it's implementation is
fundamentally ineffecient. Most scripting languages compile to bytecode
which is then processed by a VM. For example, the Lua VM is less tha 2K
lines of code and can fit into L2 cache which is why it's blistering
fast
https://secure-web.cisco.com/1toUKHC4qJ1L65nxMUHlKxOYU0nCw63de1WYnrGbKff1yrwqYGas-OyWjVfJCDmHbQ8-AEVUh6XufmmTHQpXuiui1Oz3dT6hK9s0lRpekgPRdl4akdM0MwK100qVFGPYGqGt81W8-MPFrje4gSpXNazzn4fMSiHGgSWDamtQAH5tueZ_8T8aa5iE1pL9UvLLcIjjfsFGUK-P4tUucjxCM8HO0LyO8nmOWh_0CeNAdWcuWTrN5Em2BLnvFL5WapeGIHJvU2D9PJmk3_BsvxgPJfOMtt2RV2r4gqg7t_Xgjannaba2uFqkrW9h4s00If0apuc23VCaI-qz9jjywnRdKULdBrJcCqDYBtHL27rlQwQ3tbdu4b4XEqaAk6QlYej9JA7eII2tBWpYbOg_-qjjJhbabjho8C4tTZgJ8jb5GWs9S2bP9ztKJFOjoVG-toKSS/https%3A%2F%2Fwww.lua.org%2Fsource%2F5.1%2Flvm.c.html.
ooRexx chose to use a
graph of C++ classes with abstract base classes for every instruction
and clause. OMG, dynamic dispatch for every instruction!
https://secure-web.cisco.com/1x1EEYRKnnOq4ErWK3XEX2TNTsQD0UuiUNjaIlV74LtBLh321aBDX8DuBmGkeEwlVa2nEDe_0WiZceoWQpQpAlJAptvu2Pgsg3VfvzAc19VMyrkgP6hFgWGpmex9xKNvxIu8OjmtH2TCcgPcTS0QhVf7T-8hfM-Ajwx_i-XiuIwhPspCAux-kzFz7ipM7H6Q8Fr-i2xzGtLJC4YOPthkFUUz7q-t-QNpKAT7Ueqfl3gLB-TNHYgYvg5Mo36B2KhDB4Q36sHe5f2XVg3KnPmIRV3q_AxuZAhQYGyJozZbO9cMrzV6UaF942P531jtLuMYxf1UtWbXlw89wSf8QVdMN5E6F0p9eylZcPucm5blJUIF9Ws0BIe4nj4OSooCHL1QoVyAw2_-Hw9nsWU6t-c0mjjDw4ou64vahrdNYommLhznZK49gubwnaoT9tKaLVwbc/https%3A%2F%2Fgithub.com%2FooRexx%2FooRexx%2Ftree%2Fmaster%2Finterpreter%2Finstructions
It's gigantic clump of inefficient code based upon inheritance. The GoF
Design Patterns book which dates back to the 90s was a groundbreaking,
seminal work which had a central theme of introducing patterns to avoid
inheritance. Modern languages like Rust don't even support Inheritance.
If you want high speed then use a JIT compiler. The Lua Functional
library used with LuaJIT can boil a chain of method calls down to a
dozen instructions with no linkage overhead
https://secure-web.cisco.com/1VGsux3zwLoFPlfRJthZWOyRRuMwoUesawXiAoOEGNBSpwc8MJTo_mTKwvCEMkjgvHvlY-YaKdYzPaVz1dG1h6YFTiRsgrq0TwNPjdMt2oUIMlwjqLKvM7q_jCe7R8HwQLHyRZ2uQZS6Vt4fHDBgmNbTBc_0cjIKlJ7JyekEm2GEDauJ5o8jonSS747C4tVgfM6MLLcz6ctR9YUeUKvqE0r45xSXwYFz0tC4jg3dus4FrE9VmJPakzfNzH-Uzr0mJJwtpBqkiF6E4WvuMsxJwF6pKRHyrJvM9f4iGcBHa9-m5OcGOaaLxIc_johKMK7lU4fpLGKg5Q9bVczgMOrGrRAFOGkfVJJ8dc_UPTacOUKlWFmWnLWPrssX62RX0gtKqr0RyYegQ_TD8Irzb9oX_9SE4ZY8b1vdh5HnsxNpeTEsECVs9J7PBcRh9l_YcuM5XllzvcAi9NeVF_L_pRcEaWg/https%3A%2F%2Fluafun.github.io%2Fintro.html.
The Julia programming language can
do the same with similar syntax. If I wanted to use REXX
I would use NetRexx to take advantage of the JVM JIT.
Again it is fairly straight-forward and easy to add external routines
and external methods to ooRexx
if need be.
---rony
----------------------------------------------------------------------
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
----------------------------------------------------------------------
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