home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.next.hardware
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!kronos.arc.nasa.gov!iscnvx!netcomsv!netcom.com!abell
- From: abell@netcom.com (Steven T. Abell)
- Subject: Re: Byte Swapping (Was: New RISC workstations)
- Message-ID: <1992Nov6.202712.22966@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- References: <1992Nov2.195519.612@netcom.com> <1992Nov5.065817.4662@relief.com>
- Date: Fri, 6 Nov 1992 20:27:12 GMT
- Lines: 47
-
- jjfeiler@relief.com (John Jay Feiler) writes:
-
- > In article <1992Nov2.195519.612@netcom.com> abell@netcom.com (Steven T.
- > Abell) writes:
- > > eboltz@jhunix.hcf.jhu.edu (Eric Scott Boltz) writes:
- > >
- > > > As far as Intel CPUs go, aren't they the ones that expect multiple-byte
- > > > data to have bytes swaped? - Yuck.
- > >
- > > As far as I'm aware, nobody has *ever* made a machine that got
- > > byte-ordering right in combination with several other crucial factors.
- > > This has had an unpleasant effect on sofware quality.
- > > [munch]
- > >
- > > The design I suggest is very different from what we're used to,
- > > but it works just as well in the machine, and better in our heads when
- > > we're writing programs. That translates into fewer bugs.
- > >
- > > 0) All memory diagrams are written sideways,
- > > with the most-significant bit, byte, word, whatever, on the left.
- > >
- > > 1) The base address of a string, struct, array is its *end*,
- > > not its beginning.
-
- > Unfortunately, many string operations (formatting strings, strcat, etc) will
- > grow the length of the string, and we than have to copy the entire string to
- > a buffer, operate on it, then put it back with its end in the right place.
- > Sigh......
-
- Partly true. The left-to-right-is-high-to-low-always scheme invalidates
- some C-think. With a system and a language designed as I suggest, the
- mechanics of string processing will have to be different, but not much,
- and it will usually be more efficient. The only real implication of this
- design for the specific problem John describes is that string pointers are
- less constant. Algorithms that really require buffered copies in my scheme
- will also require copies in a standard C program.
-
- To digress a little, one of the most frequent complaints I hear about C is
- its string-handling (in)ability. I hate to even mention the word, but BASIC,
- for all its wretchedness, is still the weapon of choice among traditional
- languages for string manipulation. There are fairly simple ways of putting
- that kind of functionality into a C-like language, and for that, the
- left-to-right-etc. design is ideal.
-
- C is twenty years old. Maybe it's time to take what we've learned and move on.
-
- Steve abell@netcom.com
-