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



From: Steve Richter

( On the .NET vs i5/OS front, the comparison that I am interested in
is languages that garbage collect vs those that dont. C++ used to be
important. Almost overnight, with the adoption of managed code by
MSFT, it is legacy because it does not GC. Garbage collection in RPG
would work really well for its many business oriented programmers. )

Okay, I'll relax the restriction for just a moment and answer this question
even though you again are talking about a technical issue that really
doesn't matter to application programmers.

Why do you think RPG needs garbage collection? The only reason you need GC
is when the programmer dynamically allocates memory outside of the OS and
doesn't give it back. In OO languages this is an absolute requirement
because of the creation of millions of transient objects which are never
explicitly destroyed, but in procedural languages it's unnecessary. The
only reason you need GC is if you start adding a bunch of dynamic memory
allocation, and frankly that's why I don't want RPG to start looking like
Java - I don't need all that extraneous crap. If I need objects, I'll use
Java. If I don't, I'll use RPG.

Now, in order to make OO virtual machines work outside their sandbox, there
are GC issues, which is why most folks don't do it. At the most, they might
let Java call their native non-Java functions (through JNI), but rarely vice
versa. In a rather stunning architectural achievement unlike any other
operating system that I'm aware of, the i5/OS interface between RPG and Java
has support to directly invoke Java methods, and thus there is a need to
directly invoke the GC functions -- which IBM has provided and which Barbara
has kindly shown in specific detail in other posts.

So, again, the question is simple: why does RPG need GC? If it doesn't have
OO and you occasionally allocate your own data structures, then you can
clean up after yourself. And if I'm not mistaken, you can even use
activation group boundaries to clean up for you -- I believe (but I'm not
sure) that any memory allocations done by a job are released when the
activation group ends. Maybe someone more knowledgeable like Scott, Bruce
or Barbara can chime in.

Joe


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.