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



On Mon, Jul 21, 2014 at 2:45 AM, Scott Klement
<rpg400-l@xxxxxxxxxxxxxxxx> wrote:
I like the database integrated with the programming language a whole lot,
but moving to a language like JAva, PHP, Python or Ruby would eliminate that
deep integration. This is one of the reasons I cited that I would stick
with a native language like ILE C++ rather than use one of these others.

Are you speaking from experience with PHP, Python, and Ruby on the i?
(This is not meant to be insulting; I honestly don't know if you have
used them, or if you merely "know about" them.)

The "official" implementations of PHP and Ruby on the i use PASE, so
if this fact in itself already limits the degree to which you can
integrate with the underlying database, then I certainly can't argue
with you. I use neither of these languages, nor do I really know the
nitty gritty details of PASE. I do know that PHP for i includes some
record-level access facilities which let you approximate RPG-style
database programming (no cycle, of course).

What I can definitely speak from experience about is iSeriesPython,
which is implemented natively, with ILE C. Its record-level access
facilities are actually pretty good. What it doesn't do that RPG does
is automatically load fields into same-named variables (this would be
a mess in Python for a variety of reasons), but it does something
close, which is load up a record object which lets you reference the
fields by name. (So sort of like a qualified data structure. More
like an associative array in some other languages.) Or you can access
them by ordinal position in the record.

Of course, it doesn't replicate the cycle (nothing does, and many RPG
programmers stay away from it anyway). So, I don't know exactly how
"deeply" the integration with the database goes for RPG and ILE C++,
but I wouldn't say it's eliminated if you go with Python. Possibly
attenuated, but still extremely usable and productive from a
programmer's perspective. Using SQL or a mix of SQL and RLA in the
same procedure is at least as easy in iSeriesPython as in RPG (in my
opinion, it's much easier in iSeriesPython).

Then there's messages, job logs, ability to look at details of a job
(open files, call stack, etc) as the job is running that I miss a lot
when working on a Windows machine. Are similar things available on
Windows or Linux that I'm not aware of? (I wouldn't be surprised)

This is an important piece to me...

It was one of the big reasons that I gave for sticking with a native
solution like ILE C++ rather than using something like Java, PHP, Ruby, or
Python. These environments use the Unix-style of error handling rather than
the job logs, et al.

iSeriesPython definitely does not make as extensive use of system
messages and job logs as the IBM in-house languages. But at least it
runs natively instead of in PASE, and it dumps what would be stdout
and stderr to spooled files, which serve as a job log of sorts. While
it's running, you can look at its open files and call stack the usual
way.

Speaking of the call stack, iSeriesPython can easily call native
programs (RPG, CL, system APIs, anything that uses the normal call
interface) and get parameters back from them.

By no means is iSeriesPython the end-all, be-all language for the i.
If it seems like I overpromote it, it's only because I feel it doesn't
get the exposure it deserves. It's an extremely productive tool, kind
of like RPG, Java, REXX, and CL rolled into one, but also with some
powerful capabilities not found in any of those languages. Compared
to PHP and Ruby, Python's syntax is much less "noisy" and, I believe,
much more accessible to folks who haven't strayed much out of RPG; and
its standard library is more extensive and mature ("batteries
included" is one of Python's mottos).

I know I've droned on too long already, but a final word on Python's
accessibility: I've tried to learn lots of languages. I used Basic
and Pascal on my own as a kid (and loved them), and C a lot in high
school and college (and loved it), and I figured moving on to C++
would be the natural thing to do. I was able to pick up the new
comment syntax and simplified print facility, but found it difficult
to get much beyond that. I tried Java, and it was a lot easier than
C++ (I finally understood the concept of classes while studying Java),
but the sheer hierarchy of standard classes and bureaucratic verbosity
was overwhelming. I tried PHP, Perl, and Ruby. In principle, these
are approximately at the same level and style as Python, but all were
too noisy for me.

Ultimately, even though I *wanted* to learn other languages, Python
wound up being the one that I found easiest and most natural. I just
went through the tutorial that comes with Python (regular Python, not
iSeriesPython, which I didn't realize existed at the time) and came
out of it pretty comfortable with the language. As I tried to come up
with things to write, I often found that it was already in the
standard library. It's really a remarkable language, attracting
beginners and programmers at the highest levels alike. It's worth a
good look. And for the i in particular, iSeriesPython is so easy to
install, fire up the interpreter, and get going with quickly. (I
still haven't managed to get to the point that I can even do "Hello
world!" in PHP or Ruby for the i. I do welcome help with that, by the
way!)

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.