[comp.lang.c] Elevators

diamond@csl.sony.co.jp (Norman Diamond) (10/30/89)

In article <1159.25475CBB@urchin.fidonet.org> Bob.Stout@p6.f506.n106.z1.fidonet.org (Bob Stout) writes:

>For example, an elevator controller (a typical  
>job for me) may be an exercise in AI programming, but if you try to tell a  
>controller manufacturer what sort of hardware you'll require to write it in  
>LISP or Smalltalk, you'll find out in a hurry what competitive pricing means  
>as they show you the door! 

But it also can't be programmed in C!!!!  ANSI says that the execution
character set must include a carriage return, audible alarm (well --
I guess an elevator has that), vertical tab (does an elevator have
that?), horizontal tab, and a bunch of ASCII-like characters.  And
you gotta have fseek().  Anyone want to design a C standard for a
stand-alone environment, which ANSI forgot to do?

-- 
Norman Diamond, Sony Corp. (diamond%ws.sony.junet@uunet.uu.net seems to work)
  Should the preceding opinions be caught or     |  James Bond asked his
  killed, the sender will disavow all knowledge  |  ATT rep for a source
  of their activities or whereabouts.            |  licence to "kill".

henry@utzoo.uucp (Henry Spencer) (10/31/89)

In article <11038@riks.csl.sony.co.jp> diamond@ws.sony.junet (Norman Diamond) writes:
>But it also can't be programmed in C!!!!  ANSI says that the execution
>character set must include a carriage return, audible alarm (well --
>I guess an elevator has that), vertical tab (does an elevator have
>that?), horizontal tab, and a bunch of ASCII-like characters.  And
>you gotta have fseek().  Anyone want to design a C standard for a
>stand-alone environment, which ANSI forgot to do?

Please read the standard before you say such things.  This is a "free-
standing" implementation, which is *not* required to provide fseek()
and the like.  And while the various characters are still required to
exist in the character set, there is no requirement (in either hosted
or free-standing implementations) that any device capable of doing
anything useful with them be present.
-- 
A bit of tolerance is worth a  |     Henry Spencer at U of Toronto Zoology
megabyte of flaming.           | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

gwyn@smoke.BRL.MIL (Doug Gwyn) (10/31/89)

In article <11038@riks.csl.sony.co.jp> diamond@ws.sony.junet (Norman Diamond) writes:
>In article <1159.25475CBB@urchin.fidonet.org> Bob.Stout@p6.f506.n106.z1.fidonet.org (Bob Stout) writes:
>>For example, an elevator controller ...
>But it also can't be programmed in C!!!!  ANSI says that the execution
>character set must include a carriage return, audible alarm (well --
>I guess an elevator has that), vertical tab (does an elevator have
>that?), horizontal tab, and a bunch of ASCII-like characters.  And
>you gotta have fseek().  Anyone want to design a C standard for a
>stand-alone environment, which ANSI forgot to do?

Don't be absurd.  Any modern character set (e.g. USASCII) meets the
requirements of the Standard.  The character display semantics of
Section 2.2.2 are not only merely a statement of intent, not a firm
requirement, but also apply only to writing characters to a display
device, which is done in Standard C only by invoking an appropriate
library function.  However, in the freestanding environment, the
usual standard library functions are not required to be available.
Thus there is no reason at all to think that the C characters that
in a hosted environment have certain intended functions when written
to a display device need have any function at all (other than as
integer code values) in an embedded (freestanding) environment.

Bob.Stout@p6.f506.n106.z1.fidonet.org (Bob Stout) (11/09/89)

In an article of <2 Nov 89 18:17:31 GMT>, (Norman Diamond) writes:
 >>In article <1159.25475CBB@urchin.fidonet.org> 
 >Bob.Stout@p6.f506.n106.z1.fidonet.org (Bob Stout) writes:
 >>
 >>>For example, an elevator controller (a typical  
 >>>job for me) may be an exercise in AI programming, but if you try to 
 >tell a  
 >>
 >>But it also can't be programmed in C!!!!  ANSI says that the execution
 >>character set must include a carriage return, audible alarm (well --
 >>I guess an elevator has that), vertical tab (does an elevator have
 >>that?), horizontal tab, and a bunch of ASCII-like characters.  And
 >>you gotta have fseek()...

  Uh, I hate to tell you this, but there's an awful lot of embedded  
applications, things like microwave ovens, TV's, VCR's, automotive systems,  
laser printers, SCADA systems, and controllers of all types programmed in C.  
So what if the character set is never used? So what if there's no file I/O? So  
what if it runs out of ROM instead of in a hosted environment? Look around -  
there's a whole world of computers you never see simply because they don't  
*look* like computers. And there are plenty of C compilers for chips like the  
805x, 6303, 65xx, 68xx, and lots more you probably never heard of. Besides,  
one of the hottest ways of building small quantities of specialized  
controllers these days is using 80x86 based controllers running DOS  
look-alikes out of ROM. Files, if any, can be in battery-backed SRAM or  
EEPROM, with write-protected files being read out of ROM. Console I/O is the  
terminal you hook to the RS-232 port for running diagnostics.

  Sorry I missed this message the first time around - but in all honesty, I  
never expected such parochialism in this newsgroup. This stuff has been around  
for years - I've been using C in embedded applications starting with 6502 uP's  
since '81 or so.