I'm not really disagreeing with any of the comments on this
interesting thread;   My $.02 -

- The influence of good application architecture, design, and
implementation is nearly always more important than the choice of
language.

- Good developers usually pick the right tools for the job.
Assembler, C/C++, Java, PL/x, COBOL, and REXX are all great languages
on z/OS when used correctly.

As pointed out earlier on this thread, the choice between using
Assembler and a HLL for performance-critical code is a little
complicated.    I'm a decent assembler programmer, but I'm completely
intimidated by the code generated by the IBM C/C++/Metal-C and Java
JIT compilers.  As Metal-C offers the ability to mix assembler and HLL
together I find less and less need to write pure Assembler.

Consider this function, which Metal-C will happily inline into calling code:

static char const itoa_mask[13] =
{'-',0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x21,0x20,'\0'};
static char* itoa10(int i, char* buf13) {
  unsigned char packed[8] __attribute__((_aligned__(8)));
  unsigned char* pSigdigit = buf13 + sizeof(itoa_mask)-2;
  memcpy(buf13, itoa_mask, sizeof(itoa_mask));
  __cvd (i, packed);
  __edmk( buf13,
          packed+2,
          sizeof(itoa_mask)-2,
          &pSigdigit);
  return (i < 0) ? pSigdigit-1 : pSigdigit;
}

Sure, an assembler macro would generate the same handful of
instructions inline as Metal-C, but would the assembler then rearrange
the instructions to optimize pipeline and cache-hits? (using techniqes
that I don't even understand :-)   Does IBM even publish the
information necessary to really optimize code for the current
instruction set?

Maybe there would be a market for a code optimizer that would process
the ADATA output from HLASM (or even existing load module text) and
apply optimizations to it?   Maybe it could even dissect code into
pieces for enclave-mode SRBs :-)

Kirk Wolf
Dovetailed Technologies
http://dovetail.com

PS> If Metal-C were extended to (somehow) directly support existing
bi-modal BAL-PL/x macros, there would be very little need for us to
write assembler.   This would be the single biggest thing that IBM
could do IMO to foster application development on z/OS.

Reply via email to