× 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.



Steve Richter wrote:
Which lead me immediately to upgrade my opinion of Java and start the
process of asking why RPG is not made to compile down to Java bytecode.
What I am interested in is mixing Java and RPG  without the need of a
cumbersome interface barrier.  That is why microsoft's CLI has my attention.
In my windows C++ code I can mix in C# and VB.NET classes without much
hassle.

So what prevents the RPG compiler from translating RPG to Java ByteCodes?
Esp if VisualAge RPG possibly does.  The thinking being that if RPG can
translate to ByteCodes, then the programmer can also natively reference Java
classes contained in the Java ByteCode stream emitted by the compiling of
Java code.


First, sure, VARPG has the /option/ to generate Java bytecodes, however there are some limitations. I don't have the details at hand, but I believe there are certain RPG language constructs that cannot be implemented properly within Java bytecodes.


But as I've pointed out a number of times previously, there are basically two styles of programming language in common use: compiled and interpreted. Compiled languages, like RPG, COBOL, and C allow efficient use of machine resources at the byte level. In these languages, you normally map out storage at a byte by byte level. Static binding (as provided by ILE) provides a mechanism at a low level to resolve names in modules to resources in other modules. Typically, it is up to the programmer to ensure that definitions of imported and exported names match.

On the other hand, interpreted languages provide a much richer level of functionality, typically with objects and classes (at the expense of run-time speed). Because of the complexities of object implementation, interpreters must manage all aspects of the storage of objects, including things like garbage collection. Byte by byte management of objects is not just impractical in such a system, it's error-prone and downright silly.

This all just illustrates my point that we are comparing apples and oranges when comparing these two classes of languages. The issues and trade-offs are just different. And so the differences make interfacing between these two classes of language awkward at best. For a program in a compiled language to call a program in an interpreted language, you basically need to establish the interpreted environment for that called program. Thus, you necessarily have this "interface barrier".

Sure, if VARPG can generate Java bytecodes, I suppose the ILE RPG compiler could to with some effort. But then you'd lose the advantages of compiled code while gaining few of the benefits of the Java run-time environment. If you really want to use Java objects, you're way better off just programming in Java.

To get back to MS programming, it's really just the same. You can choose to target your program either to the Intel instruction set or to the CLI sandbox. With one, you have a static binding environment offering efficient use of machine resources at the byte level; with the other, you have a robust object framework. Pick one.

Cheers! Hans



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.