Earlier quoted context omitted.
It makes sense long would have needed a comment. It needs a comment because “long” and “double” are terrible names for data types. Long what ? Double length what ? Those type names could easily have opposite meanings and meant long floating point / double length integer. WORD/DWORD are nearly as bad - calling something a "word" incorrectly implies the data type has something to do with strings. If you don't believe m…
No, the names are fine and self evident after glancing through K&R for 15 min. The real mistake in retrospect is that int and long are platform dependent. This is an amazing time sink when writing portable programs. For some reason C programmers looked down on the exact width integer types for a long time. The base types should have been exact width from the start, and the cool sounding names like int and long should…
Dennis Ritchie’s first C compiler (c. 1972)
111–120 of 163 posts
Re: Dennis Ritchie’s first C compiler (c. 1972)
#112Earlier quoted context omitted.
And he was almost certainly using ed(1) as his editor and a mechanical teletype at 7.5 or 10.0 characters per second as his terminal... The C language (and all of Unix) was designed to be very terse as a consequence.
That period lasted what, 10 years after Unix was created? And we'll be stuck with those decisions decades if not centuries. Similar story with the design of QDOS / MS-DOS / Windows and nowadays with Android. Both designed for super underpowered machines that basically went away less than a decade after they were launched and that will be hobbled because of those early decisions for a long, long time.
If they had gone for wart-free on properly powered hardware, they would be stuck back in Multics land or living with the gnu Hurd—cancelled for being over budget or moving so slowly that projects that actually accomplish what the users need overtake them.
Do I wish that C had fixed its operator precedence problem? Sure. But the trade offs as a total package make a lot of sense.
Re: Dennis Ritchie’s first C compiler (c. 1972)
#113Earlier quoted context omitted.
> ask a non programmer Why should a non programmer understand programming terms? Words have different meanings in different contexts. That's how words work. There is no need to make these terms understandable to anyone. The layman does not need to understand the meaning of long or word in C source code. Ask a non-golf player what is an eagle or ask a physicist, a mathematician and a politic the meaning of power. Word…
It's about cognitive load. The more jargon diverges from concepts you already have learned and used for years, the more difficult it is to adapt. As an experiment, try replacing all of your variable names and types with numbered variables: v1, v2, v3, etc. Then compare to replacing them with words: not completely random words, but with completely misleading words, like the complete opposite of what they represent, le…
See economics for a great example of jargon-vernacular crossover.
Re: Dennis Ritchie’s first C compiler (c. 1972)
#114Earlier quoted context omitted.
Yes, bootstrapping with regard to languages is the trick of getting that first compiler running so you can compile the rest of the compiler. It has been done many times. The first assemblers were written directly in machine language. The first compilers were written in assembly. Many implementations of FORTRAN, ALGOL, COBOL, etc. As late as the 1970s it was not unknown to write a new high level language directly in m…
> Steve Woz's BASIC for the Apple II was "hand-assembled", as he put it. Very cool - so basically (haha) Woz's integer BASIC was bootstrapped by writing it in assembly language and translating it into machine code by hand. I wonder if someone (Woz?) has written a 6502 assembler in integer BASIC to allow it to bootstrap itself?
So most weren’t exactly bootstrapped the way we are talking here.
Re: Dennis Ritchie’s first C compiler (c. 1972)
#115Re: Dennis Ritchie’s first C compiler (c. 1972)
#116Earlier quoted context omitted.
It's about cognitive load. The more jargon diverges from concepts you already have learned and used for years, the more difficult it is to adapt. As an experiment, try replacing all of your variable names and types with numbered variables: v1, v2, v3, etc. Then compare to replacing them with words: not completely random words, but with completely misleading words, like the complete opposite of what they represent, le…
Jargon that builds on intuition can be its own problem. Jargon, by its very definition, has explicit technical meaning in a specific domain. Intuition in words is based on vernacular usage. It is vanishingly unlikely that the vernacular usage aligns with the domain-specific usage of a given term. This leads to plenty of false assumptions, and forces people to disambiguate jargon-usage vs vernacular-usage, which may b…
Sure it can, which is why you gotta be double-careful naming things and not try to take metaphors too far. A jargon term needs to crisply identify the crux of the concept and not confuse with irrelevant or misleading details.
Re: Dennis Ritchie’s first C compiler (c. 1972)
#117Earlier quoted context omitted.
And what does it mean there? (automatic storage duration)
Do you mean automatic type deduction? Edit : I know it’s also storage specifier but it also does type deduction here, hope I’m not confused with the terminology
Re: Dennis Ritchie’s first C compiler (c. 1972)
#118Earlier quoted context omitted.
Unsure why you’re being downvoted, IIRC the original C programmers reference spoke explicitly about how “int” meant the most efficient unit of storage on the target machine. Admittedly I read that more than 30 years ago :-O
An int in C was 16 bits until about 1980 when Unix started being ported to larger machines. C and Unix were originally just for the PDP11.
Alan Snyder's 1974 masters thesis [1] describes the Honeywell 6000 GCOS port in some detail. In 1977, there were three different ports of Unix underway – Interdata 7/32 port at Wollongong University in Australia, Interdata 8/32 port at Bell Labs, and IBM 370 mainframe port at Princeton University – and those three had C compilers too.
[0] https://www.bell-labs.com/usr/dmr/www/portpap.pdf
[1] https://apps.dtic.mil/dtic/tr/fulltext/u2/a010218.pdf (his actual thesis was submitted to MIT in 1974; this PDF is a 1975 republication of his thesis as an MIT Project MAC technical report)