× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re[2]: Bitwise ops in RPG
  • From: boldt@xxxxxxxxxx
  • Date: Fri, 17 Nov 2000 08:15:45 -0500
  • Importance: Normal



Eric wrote:
>Just out of curiosity, is the W-Code compiler available as a
>product? For language ports to the AS/400 this seems like it would
>be the logical choice of what to emit as intermediate code. I would
>love to see the syntax of the language anyway :-)


I believe the W-Code documentation is available as a PRPQ, but
the licence fees limit its availability to serious developers
only.  And when I say "serious", I really mean "SERIOUS".  It's
a technology intended only for compilers and not for user
programs written in "W-Code".

W-Code is basically a set of binary data streams that implement
some abstract low-level machine.  The data streams were designed
to easily enable aggressive optimizations.  This is in contrast
with MI, which is a high-level, human-readable language.  MI was
originally intended to make it easier to write compilers.  But
in practice, the higher-level language is often more trouble
than its worth.  Designed properly, it's just as easy to write
a compiler that targets a low-level intermediate language than a
high-level one.  One problem with a high-level intermediate
language like MI is that while it may be easy to implement most
language constructs, the special cases will kill you.  And
languages that don't easily match the semantics of MI (like C),
become much more difficult to implement.

So, a binary, low-level intermediate language has several
advantages:  Compile-time performance is better since there
isn't a phase that translates a textual IL into binary.  It's
actually  easier to match high-level language semantics to a
low-level IL than a higher level IL.  And low-level IL's are
easier to optimize.

What do W-Code operations look like?  It's basically a stack-
based architecture with loads, stores, add, subtract, tests,
branches, etc.  If you've done any 80x86 assembler programming,
you'd know roughly what it's like.

Cheers!  Hans

Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.