Mailing List Archive

Re: portability, unix calls, and perl
Re: portability, unix calls, and perl [ In reply to ]
>As for the reason why I think this is so important -- I know firsthand the
>reaction of several technical managers when they were looking at code th<SNIP>
>*not* fully portable was put out for sale on the marketplace.
>Needless to say, it was ugly.

>They looked at the most nit-picky things without concentrating on the core
>functionality..

>*sigh*

>That's why I look forward to a perl compiler, and that's why I think it <SNIP>
>the effort to make perl as compile ready as can be...

A compiler doesn't make perl portable. Using `backticks` doesn't
have to make it nonportable, although it doesn't help.

If you re-orient your way of thinking of this it would help. Many
companies ship things written in perl. They tend to ship a known copy
of perl as well in case version problems should arise.

--tom
Re: portability, unix calls, and perl [ In reply to ]
On Fri, 10 Nov 1995, Ed Peschko wrote:

> What I was thinking about was stripping apart existing commands (implementations
> of ls, etc) and coding them as C calls (which then could be interfaced into
> perl without shell.) This is prefaced on the supposition that there *are*
> portable versions of ls/pwd/cd/etc.. out there. Which may be a mistake, in which
> case, yes, they would have to be recoded in perl.

Look at BSD or GNU. Yes, the code exists. OK, I see where you are coming
from here... I suppose you could take all of ls, pwd, etc., and wrap them
into XSUB code.

> As for the ultra-specific stuff, there should be some 'semi-automatic code
> wrangler' which rips apart the code just like the generic, and then puts
> it together as a library call (based on argc, argv) which then could be linked
> to perl.

Heck, you'd practically just need to re-link the stuff, so main() gets
called by your own wrapper function. You'd pass in argc and argv from the
perl argument stack, and set up pipes for stdout, stderr, etc. Heck, why
not make this function part of perl, and call it backticks? :-)

> Again -- as much of the manual stuff should be handled (probably by
> perl itself, including the interface to perl's internal variable types).

XSUB!

> I have no doubts that this would be real tricky -- for one, global variables
> would be tough to handle (variable conflicts), figuring out how to incorporate
> existing Makefiles with this process, dealing with #defines, non standard code
> (without argc argv), etc.. But I wouldn't say it was impossible.

Exactly the sort of thing you have to deal with when pulling in all sorts
of libraries to use in XSUB code.

> As for the reason why I think this is so important -- I know firsthand the
> reaction of several technical managers when they were looking at code that was
> *not* fully portable was put out for sale on the marketplace.
> Needless to say, it was ugly.
>
> They looked at the most nit-picky things without concentrating on the core
> functionality..
>
> *sigh*
>
> That's why I look forward to a perl compiler, and that's why I think it is worth
> the effort to make perl as compile ready as can be...

This is a separate issue from compiling. _Really_. If you want to do
anything like this, feel free to do it via the existing XS mechanism.
Since XSUB's can be statically linked into perl, that solves the
"compiling" problem. (And doesn't impact one way or another the much
harder task of actually compiling perl code.)

> Ed

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
Re: portability, unix calls, and perl [ In reply to ]
On Fri, 10 Nov 1995, Tom Christiansen wrote:

> A compiler doesn't make perl portable. Using `backticks` doesn't
> have to make it nonportable, although it doesn't help.
>
> If you re-orient your way of thinking of this it would help. Many
> companies ship things written in perl. They tend to ship a known copy
> of perl as well in case version problems should arise.

Indeed. From what Ed's saying, it sounds like he can't even rely a decent
Unix installation to exist. Perhaps they shouldn't be using Unix if they
are having that much trouble with it...

> --tom

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
Re: portability, unix calls, and perl [ In reply to ]
Re: portability, unix calls, and perl [ In reply to ]
> From: epeschko@animas.tcinc.com (Ed Peschko)
>
> I might have been on the unfortunate side of things, but almost all the typical
> managers that have made the decisions about something (that I knew of) made
> vanilla decisions -- ie if something seemed 'funny' or 'out of the ordinary'
> they boycotted it damn fast. Dilbert comes to mind. In fact, this was the main
> reason that I became a consultant in the first place..
>
> 1) 'Funny' is being programmed in what is perceived as a simple script
> language.
> 2) 'Funny' in that you have to configure the supporting binaries correctly.
> 3) 'out of the ordinary' is having to send a binary (perl) along with it
> that has to be installed separately.
>
> Now, if I am aiming at vanilla customers(I am).. the last thing I want to have
> to do is complicate things by tagging my product with the above concerns..

My approach to this would be to not associate perl with the product directly.

I'd simply state that the product requires 'a package called perl' to be
installed on the system. Just as if it was some optional package supplied
by the unix system vendor.

Then concentrate on making a run-time perl environment which you can call
'the perl package' easily installable. Put it on a tape and wave it around.

(Sigh. Isn't politicking a pain in the rear.)

Tim.