login
Header Space

 
 

Use PERL rather than C for system commands?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-activists@...>
Date: Thursday, January 16, 1992 - 2:08 am

I've been following the Linux discussion with great interest, and I
hope to download a copy and try it as soon as I have time.

I'd like to make a suggestion to the activists group.  The suggestion
goes against the grain of typical Unix system administrator
philosophy, but I think the suggestion warrants serious consideration.

Here is my suggestion.

It seems to me that the language PERL is ideal for implementing many
of the pieces that are currently missing from Linux.  For example,
init, getty, login, shutdown, halt, cron, inetd, etc. could very
easily be written in PERL rather than C.  Most OS-support programs
(including the ones mentioned previously) are not time critical.  They
run very infrequently, and the performance degradation (if there is
any) should be inconsequential.

There are several advantages to using PERL rather than C.

First of all, programs would take up much less disk space and RAM.  It
is true that the PERL executable must be in RAM in order to run a PERL
program, but only one copy ever need be in RAM at any time, and I
think the savings elsewhere will more than make up the difference.
(On my workstation, the PERL .text section is about 4 times as large
as the login .text section.  If perhaps four or five memory-resident
programs are replaced by PERL scripts, the break-even point is
reached.)  Also, if the PERL executable is always resident, then
loading PERL programs from disk should require very little time.

A more obvious advantage is that writing PERL programs is much less
time-consuming that writing C programs.  This is due to the fact that
the compile step gets skipped, and because PERL has a built-in
debugger.

Third, I find PERL a *much* better script language than either sh or
csh.

Additionally, PERL contains special support to aid in writing secure
programs.  It is easier to write secure SUID programs in PERL than it
is in C.

Finally, PERL scripts are architecture-independent.  If Linux ever
gets ported to multiple architectures (which I am guessing it will),
all support programs written in PERL port with no effort at all.

There are several disadvantages to using PERL.

First of all, PERL must be ported to Linux.  Of course, PERL should be
ported to Linux whether or not my suggestion is adopted.

PERL is a very *expert* friendly language.  Learning to program in
PERL involves a steep learning curve.  It takes quite a bit of
practice to become proficient at writing in PERL.  I believe the
effort is well spent.
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Use PERL rather than C for system commands?, Timothy L. Kay, (Thu Jan 16, 2:08 am)
Re: Use PERL rather than C for system commands? , Timothy L. Kay, (Thu Jan 16, 2:55 pm)
Re: PERL, Arlie Davis, (Thu Jan 16, 3:24 pm)
PERL, Peter MacDonald, (Thu Jan 16, 3:14 am)
speck-geostationary