Re: 4GL vs. ESQL/C
Posted in 1991
Grace Lee says [re pros & cons, 4GL/ESQL] :
> I received many responses and some people are interested in what
> I got. Thanks for all of people responding to my question. The
> summary is as follows:
>
> 4GL can invoke shell program, ESQL/C and C programs and it's
> also easy to manipulate screen and user interface in 4GL.
> However, only ESQL/C offers the capability to access the low
> level C and UNIX functions. The general guideline is use 4GL to
> do SQL, user interface works and use ESQL/C to utilize the low
> level functions. But if you want your implementation to be more
> easily ported to other DBMS verdor environment, you may consider
> the ESQL/C. Because 4GL is very informix dependent.
A couple of other points might be worth mentioning, too.
i. I-4GL can invoke shell progs, ESQL/C and C progs by using
RUN "ls -l /etc/passwd > foo"
or similar.
ESQL/C can do the same by using (at the dirtiest)
system("ls -l /etc/passwd > foo");
Of course, you can also read the output from a pipe and
do a load of other useful things.
ii. It is very easy (if slightly ugly) to call C functions
and Unix system calls from I-4GL. The details are in the
manuals, if you have any trouble let me know and I'll send
you an example. Honest, it's easy !
It's not (yet ?) possible to call I-4GL functions from ESQL/C.
Full blown executables can be run dead easy, of course, like
ls above.
iii. It's fairly simple to rig a custom user interface with C
routines (using a customised perform, if I remember rightly)
altho' it is much easier with form4gl and OPEN FORM.
Then link in the C stuff if you really need it.
iv. ESQL/C will tend to have rather smaller executables (say
100KB instead of 200KB) and be quicker, partly for that reason.
Against that, you'll have many more lines of code, which some
guy has to type in and maintain. Also, I-4GL is much
easier to learn than C (no, I'm not knocking C, it's just
not aimed at the same market).
v. ESQL/C *may* be easier to port to another DB author than
I-4GL, but remember that a lot of the features that give
you speed (e.g. cluster indexes) are not portable from DB
author to DB author. In other words, you may find it
ports easy and runs like a dog.
Of course, I-4GL is strictly Informix. Luckily, they're
not *too* small ... they tell me 450 platforms, which
covers most.
You may also want to write 4GL code in the "new" DB
author's 4GL (e.g., Ingres, since we started by talking
Informix) for the same reasons as you'd choose I-4GL. I'm
not quite sure what you do in that case, except code up a
custom translator.
vi. For just plain 'ol SQL, I still like shell scripts:
isql foobar <<!!
select lname, fname from emp where emp_id = $1
!!
It's *very* slow to start (cos of the size of isql, I
suspect) but its strictly ASCII and dead easy. Avoids
c4gl *and* cc. Also, you can cat stuff into isql and/or
have it read from a named pipe - then write the output
thru awk & co.
Hope some of these are interesting/useful. Abuse and flames
accepted but I'd prefer some constructive criticism if you think
I'm talking rubbish. Any big differences between what I've
said and the RDS system, I'd love to know.
BTW., I'm independent but prejudiced.
Cheers - Tony.
____________________________________________________________________________
Who: Tony Heskett | DHL Systems Ltd, Kings House,
How: theskett@lhr-sys.ssf-sys.dhl.com | Great West Road, Brentford, TW8 9HS
Vox: (+44) 81 747 8330 x 363 | Fax: (+44) 81 747 0875