[comp.lang.c] Book on MS C

erc@pai.UUCP (Eric Johnson) (03/31/89)

In article <225800147@uxe.cso.uiuc.edu>, mcdonald@uxe.cso.uiuc.edu writes:
> 
> mcdonald@uxe.cso.uiuc.edu:
> 	"Portability" is a word seldom heard outside the academic discussions
> 	of Usenet.

I find it rather amusing that I never really heard the dirty word
"portability" while in college.  Only out in the so-called "real world"
did it rear its ugly head.




> 
> gwyn@smoke.brl.mil (Doug Gwyn):
> 	That's utter nonsense.[....]

I usually agree with this chap, and this is no exception. (But I would,
perhaps, use less strong language.)


> 
> Me again [Doug McD.]:
>        It is silly to assume that there is no tradeoff between portability
>        and performance. It is true that in most cases it can be carefully

> 
>        But, doing certain things portably can cost dearly. Graphics is
>        one area. Not using the full functionality of a machine's
>        special features is another. I was, and am, talking not so much
>        about the "core" functionality of a program as I am about 
>        the user interface. And, I must emphasize most emphatically,
>        that a portable user interface MUST either be machine-specific
>        or be crippled by using the lowest common denominator (i.e.
>        a tty emulator text interface.) People who think that they can 
>        get away with a (codewise) portable user interface are either
>        deluded or working in a sheltered market segment (accounting
>        programs for cookie shops?)
> 
> Doug McDonald

Maybe I am deluded...

Have you ever looked at the X Window System?  Right now, I am writing this
on a Sun 386i running X11 R3.  The HP 9000/320 in the next room also runs
X.  A Sun-3/260 we had on loan awhile back ran the exact same code as the
Sun 386i--all under X. Under X, I find the user interface is the easiest
to port between machines (if they run X of course :-).  The silly little
processor stuff like Intel and Motorola byte-ordering is usually harder.

You can run X on an IBM PC.  You can run X programs (but apparently not
an X server) on a Cray supercomputer.  Right now, X is just about your
only hope for providing a consistent look and feel on a graphical interface
across machines from multiple vendors.  X is most definitely NOT a
"tty emulator text interface."  X supports most any graphics you can
imagine and a lot you would never think of.  It supports zillions and
zillions of options (which, of course is a two-edged sword). 

Being network transparent (what a wonderful term, almost as good as
"ether" net :-), you can run a number-crunching program on the Cray
and display the program's output on an Apollo or a DEC. 

Don't get me wrong, X is not perfect.  It could be made simpler and more
consistent.  X's performance could be snappier.  But, again, X is just
about your only hope for graphical user interface portability across
multiple vendors, multiple machines, multiple keyboards and multiple
operating systems.

Besides all that, X is free :-).


Now, I am not working in what I consider a sheltered market segment.  And,
I constantly have to deal with machines from multiple vendors.  Portability
is possible.

But, I must admit that you have a point.  You can always improve performance
by optimizing for a particular architecture, or a particular graphics
monitor, or a particular co-processor.  The question is, is it worth it?
In some cases, the answer will be yes.  In other cases, though, a company
cannot afford to devote scarce resources developing code for what is
essentially a dead end.  If the code only works on a particular machine,
it does not help the company's overall software product.  The code is
only useful for the one architecture and cannot be used elsewhere.

The customization, however, may be necessary: The product may not sell 
without it.  Software development consists of many tradeoffs (and
the mere fact that IBM PCs exist is a major tradeoff :-).




Have fun,
-Eric

-- 
Eric F. Johnson          | Phone +1 612-894-0313             | Are we
Prime Automation,Inc     | UUCP:   bungia!pai!erc            | having
12201 Wood Lake Drive    | UUCP:   sun!tundra!pai!erc        | fun
Burnsville, MN 55337 USA | DOMAIN: erc@pai.mn.org            | yet?

rosenkra@hall.cray.com (Bill Rosenkranz) (04/08/89)

In article <452@pai.UUCP> erc@pai.UUCP (Eric Johnson) writes:
= [stuff about X portability]
=You can run X on an IBM PC.  You can run X programs (but apparently not
=an X server) on a Cray supercomputer.  Right now, X is just about your
=only hope for providing a consistent look and feel on a graphical interface

there is no reason (i know of, anyway) that the X server itself could not
be ported to a Cray. for example, the X-MP HSX channel is capable of very 
high speed i/o to special customer hardware, including frame buffers. i know
of several custom applications of this nature, though none specifically with
X. add a keyboard and pointing device and away we go!

-bill
rosenkra%boston@hall.cray.com

ddb@ns.network.com (David Dyer-Bennet) (04/21/89)

In article <225800159@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes:
:IF -- IF X were the standard user interface for all those machines,
:a program written to the X spec would be portable.

"Portable to environment q" means just what it says -- that the program
in question can be run in that environment.  I know of no definition
of portable that forbids you to use standard and freely available
library code to achieve this.

:But, it is NOT
:standard. Certainly not on IBM-PC's, where the standard graphics
:interface is Microsoft Windows, nor on the Macintosh, where the 
:graphics standard IS the operating system itself.

A quick scan of the boxes down at Egghead should make it pretty clear that
calling Microsoft Windows "the" standard graphics interface for IBM-PC's is
nonsense.  The vast majority of graphics programs on IBM PC's don't use
it and can't run with it.

:So, the question arises here - IS X PORTABLE? That is, if I get
:the code for X off of your Unix box (and, assuming that it
:is not filled to the gills with #ifdef IBM_PC)will it 
:compile and run on my computer with its particular graphics display?
:I find it INCREDIBLY difficult to believe that it is. The graphics
:code to generate lines, ellipses, fills, characters and pattern
:transfers is extremely dependent on the exact details of a
:graphics device and the nature of the processor. 

How did you get so far into this discussion if you know so little
about the subject matter?  Speaking very roughly (not having developed
any X applications, or ever used X), X works by having a "server"
which does the actual graphics display, in communication with the
program which does the image generation.  The system-dependent details
are taken care of by the display server (which will answer questions
asked by the actual program about things like display size, aspect
ratio, colors available and such).  The display server talks to one or
more programs wishing display services using some appropriate
interprocess communication technique, often over a network.  Thus, you
can have windows on your screen connected to programs on many
different computers around a network.

It is my understanding that the X server code has been ported to the pc
environment both under DOS and under UNIX.  That's all you need to run
any X program with its window appearing on your PC.  Making the actual
program run on the PC may be subject to the usual problems of small 
address space and 64k segments, of course.
-- 
David Dyer-Bennet, ddb@terrabit.fidonet.org, or ddb@ns.network.com
or ddb@Lynx.MN.Org, ...{amdahl,hpda}!bungia!viper!ddb
or ...!{rutgers!dayton | amdahl!ems | uunet!rosevax}!umn-cs!ns!ddb
or Fidonet 1:282/341.0, (612) 721-8967 9600hst/2400/1200/300