convincing squeak to use LF instead of CR as the line separat or...

David T. Lewis lewis at mail.msen.com
Wed May 30 00:10:36 UTC 2001


On Tue, May 29, 2001 at 03:10:53PM -0400, Stoffel, Andy wrote:
> 
> You're assuming they came from the same OS design traditions.
> They don't really.... Unix seems to be old enough that it
> can be considered something that started "fresh" while
> DOS has it's roots in CP/M which was (if I followed the 
> trail of breadcrumbs correctly) essentially a "clone" of 
> one of Digital Equipment Corp.'s PDP-11 operating systems 
> (RSX-11 ?).
> 
> So Unix comes from a "research" orientation while
> DOS can be traced back to a "business" orientation
> and it shows...

RSX-11 a "business oriented" environment? Wow, that's a stretch.

I'm no more of an expert than any of the other opinionators
on this topic, but I'd offer the observation that many computing
environments (or operating systems, or whatever) have featured
record oriented IO systems, purportedly in the interest of
efficiency, performance, or perhaps just the sales of huge
quantities of DASD and DEC disk drives.

The design of Unix (presumably with credit due to Multics and
others) hinged on a few useful insights, one of which was that
an ounce of simplicity is worth a pound of hard-coded efficiency.
I paraphrase, but I think the basic idea holds up well, and seems
to be one of the underlying principles for Smalltalk as well.
So for file systems, a simple typeless file system was simple,
but it required folks to agree to the convention that a bunch of
ASCII text followed by an <lf> was to be thought of as a "record."

The differences between Mac, DOS, and Unix are nothing more than
differing conventions, all apparently derived from trying to
extend the metaphor of a "teletype" to provide the conventions for
record-oriented IO in a typeless file system. A real teletype moves
the carriage all the way over to the left (but does not move the
platen) when it receives a <lf>. It advances the platen, but does
not return the carriage, when it receives a <cr>. And, as you might
expect, it does both when it receives a <cr><lf>. So if you were
trying to pick a "magic character sequence" to use to represent the
end of a record of text, a literal interpretation of the teletype
metaphor would tell you to use <cr><lf>. If you thought that <cr><lf>
was a waste of bits, you might end up deciding to use either <cr>
or <lf> as the terminator, not exactly like a real teletype but
close enough so that folks would understand what you meant by it.
And I think that's exactly what happened.

-Dave

p.s. All of this highlights the critical importance of developing
a good Ksr33Morph for Squeak ;)





More information about the Squeak-dev mailing list