🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #9

Re: REXX COMPILER FOR OS/2

#9
From: John E. Brock
Date: Tue, 27 Oct 1992 19:52
46 lines
2887 bytes
|> Opportunities for compiler optimizations are few and far between.
|> Nevertheless, it is possible to write a "well behaved" REXX program that can
|> provide a compiler with many such opportunities. 
|> 
|> I don't know where IBM gets their numbers from. I don't remember the
|> exact numbers that people are quoting. 2 - 40 times improvement
|> sounds familiar. The important number here is 2. However, I bet it's
|> possible to write code that compiles even worse than that. 
|> I would like to see the program that gives them a performance boost of 40.
|> Any upper limit, like 40, is going to be arbitrary.
|> 
|> --
|> Anthony T. Green                  343D St. Clair Ave W, Toronto, Ontario M5P 1N3
|> 
|> Home   (416) 968-0817             Internet: roboco!green@relay.cs.toronto.edu
|> Office (416) 340-0887             UUCP    : ...!uunet!utai!roboco!green

I have to agree that REXX does not seem like an ideal candidate for
compilation, but it would seem that the people who wrote IBM's CMS REXX
compiler have done an incredibly good job!  I actually have a working
program which runs on the order of 40 times faster when compiled.  It's
a very non-trivial math package called RXMATH, written entirely in
REXX, which calculates all the usual "pocket calculator" math functions
(log(), sin(), etc.) to arbitrary precision.  I posted it to
comp.lang.rexx on October 8.  The version I posted needs minor
modifications to run under OS/2, but I'm planning on posting an SAA
clean version soon.

Naturally if you use a language primarily as a command processor to run
other programs then you are not going to gain much by compiling.  This
would hold true even for C!  Most of the work being done by RXMATH
consists of arithmetic operations in tight loops done on what may be
very high precision numbers (1000 significant digits, for example).  I
find that the more precision I am requesting, the better the compiled
version performs relative to the interpreted version, so my performance
improvements may come from a particularly clever arithmetic
optimization (it can't just be using native machine floating point).
We have other compiled REXX programs which don't gain as much from
compilation as RXMATH, but the improvement is always very significant.
Factors of 3 - 6 are typical, and some of these programs do use OS
commands!

-- 
John Brock
uunet!csfb1!jbrock
jbrock@csfb1.fir.fbc.com
Technical Details
Message-ID: <BwspvL.5A4@csfb1.fir.fbc.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!csfb1!jbrock
References: <BwLt7n.CEs@csfb1.fir.fbc.com> <720096159snx@roboco.UUCP>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!csfb1!jbrock
From: jbrock@csfb1.fir.fbc.com (John E. Brock)
Subject: Re: REXX COMPILER FOR OS/2
Message-ID: <BwspvL.5A4@csfb1.fir.fbc.com>
Sender: news@csfb1.fir.fbc.com (Usenet News Account)
Reply-To: uunet!csfb1!jbrock
Organization: First Boston Corporation
References: <BwLt7n.CEs@csfb1.fir.fbc.com> <720096159snx@roboco.UUCP>
Date: Tue, 27 Oct 1992 19:52:32 GMT
Lines: 46