Style & Diction

While looking at some old picture of a 3B2, I remembered in college we used to use this ‘fine’ system for it’s Writer’s Workbench which revolved around the programs style & diction.

I thought it’d be interesting to see if I could track down the source, however the sources seem to have been part of the AT&T DWB package, and were not included in any of the seemingly numerous available Unix sources available on TUHS.  But thanks to this post on the TUHS mailing list, I saw this:

I know about style and diction which was shipped with BSD4.1
which (again wooly memory) was an early subset of the
whole wwb package.

Going with this, I pulled out the recently unearthed images on bitsavers of 4.1_BSD_19810710, and in the tape images sure was the source!  The only date in there is from 1979!

Deroff Version 2.0    29 December 1979

Which for a 1981 tape sure would be in the same light.  So with some fun playing with the makefiles, I had it running on Debian 8 x64!  So with a little bit of kicking I have it running on Windows via MinGW.

So for a fun example, I though I’d take Bill Gate’s forward on Inside OS/2:

 

      OS/2 is destined to be a very important piece of software. During the
next 10 years, millions of programmers and users will utilize this system.
From time to time they will come across a feature or a limitation and
wonder why it's there. The best way for them to understand the overall
philosophy of the system will be to read this book. Gordon Letwin is
Microsoft's architect for OS/2. In his very clear and sometimes humorous
way, Gordon has laid out in this book why he included what he did and why
he didn't include other things.
The very first generation of microcomputers were 8-bit machines, such
as the Commodore Pet, the TRS-80, the Apple II, and the CPM 80 based
machines. Built into almost all of them was Microsoft's BASIC Interpreter.
I met Gordon Letwin when I went to visit Heath's personal computer group
(now part of Zenith). Gordon had written his own BASIC as well as an
operating system for the Heath system, and he wasn't too happy that his
management was considering buying someone else's. In a group of about 15
people, he bluntly pointed out the limitations of my BASIC versus his.
After Heath licensed my BASIC, I convinced Gordon that Microsoft was the
place to be if you wanted your great software to be popular, and so he
became one of Microsoft's first 10 programmers. His first project was to
single-handedly write a compiler for Microsoft BASIC. He put a sign on his
door that read

Do not disturb, feed, poke, tease...the animal

and in 5 months wrote a superb compiler that is still the basis for all our
BASIC compilers. Unlike the code that a lot of superstar programmers write,
Gordon's source code is a model of readability and includes precise
explanations of algorithms and why they were chosen.
When the Intel 80286 came along, with its protected mode completely
separate from its compatible real mode, we had no idea how we were going to
get at its new capabilities. In fact, we had given up until Gordon came up
with the patented idea described in this book that has been referred to as
"turning the car off and on at 60 MPH." When we first explained the idea to
Intel and many of its customers, they were sure it wouldn't work. Even
Gordon wasn't positive it would work until he wrote some test programs that
proved it did.
Gordon's role as an operating systems architect is to overview our
designs and approaches and make sure they are as simple and as elegant as
possible. Part of this job includes reviewing people's code. Most
programmers enjoy having Gordon look over their code and point out how it
could be improved and simplified. A lot of programs end up about half as
big after Gordon has explained a better way to write them. Gordon doesn't
mince words, however, so in at least one case a particularly sensitive
programmer burst into tears after reading his commentary. Gordon isn't
content to just look over other people's code. When a particular project
looks very difficult, he dives in. Currently, Gordon has decided to
personally write most of our new file system, which will be dramatically
faster than our present one. On a recent "vacation" he wrote more than 50
pages of source code.
This is Gordon's debut as a book author, and like any good designer he
has already imagined what bad reviews might say. I think this book is both
fun and important. I hope you enjoy it as much as I have.

First we run it through style which will give the overall report on the text.

D:\diction\bin>style.cmd forward.txt
readability grades:
(Kincaid) 9.1 (auto) 9.2 (Coleman-Liau) 8.8 (Flesch) 8.5 (64.8)
sentence info:
no. sent 31 no. wds 607
av sent leng 19.6 av word leng 4.43
no. questions 0 no. imperatives 0
no. nonfunc wds 338 55.7% av leng 5.58
short sent (<15) 35% (11) long sent (>30) 13% (4)
longest sent 35 wds at sent 14; shortest sent 7 wds at sent 5
sentence types:
simple 39% (12) complex 32% (10)
compound 3% (1) compound-complex 26% (8)
word usage:
verb types as % of total verbs
tobe 33% (26) aux 22% (17) inf 13% (10)
passives as % of non-inf verbs 6% (4)
types as % of total
prep 8.6% (52) conj 4.1% (25) adv 7.1% (43)
noun 23.9% (145) adj 14.7% (89) pron 8.4% (51)
nominalizations 0 % (3)
sentence beginnings:
subject opener: noun (6) pron (5) pos (2) adj (3) art (3) tot 61%
prep 19% (6) adv 6% (2)
verb 0% (0) sub_conj 13% (4) conj 0% (0)
expletives 0% (0)

So that places it on the grade 9 level, average readability.

Now let’s see about usage errors with diction!

D:\diction\bin>diction forward.txt
os 2 is destined to be a[ very ]important piece of software.

during the next 10 years millions of programmers and users will[ utilize]
this system.

the best way for them to understand the[ overall ] philosophy of the system
will be to read this book.

in his[ very ]clear and sometimes humorous way gordon has laid out in this
book why he included what he did and why he didn t include other things.

the[ very ]first generation of microcomputers were 8 bit machines
such as the commodore pet the trs 80 the apple ii and the cpm 80 based
machines.

built into almost[ all of ]them was microsoft s basic interpreter.

unlike the code that[ a lot of ]superstar programmers write gordon s source
code is a model of readability and includes precise explanations of algorithms
and why they were chosen.

[ in fact ] we had given up until gordon came up with the patented idea described
in this book that has been referred to as turning the car off and on at
60 mph.

[ a lot of ]programs[ end up ]about half as big after gordon has explained
a better way to write them.

when a particular project looks[ very ]difficult he dives in.

number of sentences 34 number of hits 11

As you can see, Bill likes very, very much.

Explain can give you examples of what to use instead, so how about ‘a lot of’?

D:\diction\bin>bash explain
phrase?
a lot of
use "many" for "a lot of"
phrase?

Explain is a sed script, so in this case I’m using MinGW’s MSYS environment to run the script.

I don’t think much of anyone will care about text processing utilities from the 1970’s in 2016 (and beyond) but for anyone else who is bored, or found out about this by mistake, here you go!

diction.7z

You’ll get a 404 page, just read the error page for the password.

7 thoughts on “Style & Diction

    • Very strange. Ubuntu is Debian, and I was able to build there OK.. then again I did ‘fix’ this makefile for building on Windows. I’ll have to try to re-build on Debian, I know I ‘fixed’ the dictionaries to sit in the current directory.

      • And style doesn’t run properly. Style1 inverts text and style2 and style3 seem to do nothing. Can you send the makefile you used for debian?

        • they pipe between eachother. You’ll have better luck with the 4.1BSD tape. I’m out at the moment so not much I can do. 😐

          but I found running type file | style1|style2|style3 gave me the same results as an online ‘style’ program.

        • I extracted the source, and patched up the makefile. I’m on Debian but I don’t think it matters at all. It’ll build fine as long as you have FLEX.

          The source is here.

          Unless you have a real AT&T or BSD shell the style script won’t work just cat | style1 | style2 | style3 to get your result.

Leave a Reply

Your email address will not be published. Required fields are marked *