Live data from Hacker News

Dennis Ritchie’s first C compiler (c. 1972)

github.com

91–100 of 163 posts

Re: Dennis Ritchie’s first C compiler (c. 1972)

#91
post #33

Earlier quoted context omitted.

Why not just: char waste[however-many-bytes-are-needed]; ?

Can't say for sure if it's the reason in this particular situation, but that would require dynamic memory allocation, and while it may seem backwards to reserve more memory than potentially needed on old memory-constrained systems, it is a pattern you see very frequently because on those systems, you actually know exactly how much memory you have. As a result, you know exactly how much memory you can "waste". Especia…

External arrays are static, they do not involve any dynamic allocation.

Re: Dennis Ritchie’s first C compiler (c. 1972)

#92
post #43

So do I get this right: this is not the first C compiler (since that one would be written in B) and the first C compiler written in C?

Thank you for pointing this out. It obviously can't be his first C compiler because it's written in C! :)

I'm not even sure it's the first C compiler written in C, though - it just says in the github description "the very first c compiler known to exist in the wild."

Regardless, if it's from 1972 it's a very early version.

Re: Dennis Ritchie’s first C compiler (c. 1972)

#93
post #66
post #42

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…

> 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…

> Ask a non-golf player what is an eagle or ask a physicist, a mathematician and a politic (sic) the meaning of power.

All those fields could do with less jargon. Especially since in many cases there is a common word.

Lawyers especially give me the impression that they use jargon to obscure their field from regular folks.

Our field, being new, should not make the same mistakes, but yet, here we are, where the default "file viewer" on Unix is cat, the pager is called "more", etc.

I don't see any reason why those types could not have had descriptive names from the start. Well, there was one, lack of experience, so ¯\_(ツ)_/¯

Re: Dennis Ritchie’s first C compiler (c. 1972)

#94
post #80
post #60

Earlier quoted context omitted.

String doesn’t make sense either. But that’s how words acquire new meanings.

It's short for "Hollerith string". Nobody wants to type out that man's name every time they want to deal with the data type. Also, most programmers know zero about computer science.

> Also, most programmers know zero about computer science.

What made you say that?

Re: Dennis Ritchie’s first C compiler (c. 1972)

#95

Earlier quoted context omitted.

If you judge the coding style of the early 1970s with modern standards, it isn't going to look great. 50 years is a loooong time. dmr was one of, if not the first C programmer(s).

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.

Re: Dennis Ritchie’s first C compiler (c. 1972)

#96
post #86

Earlier quoted context omitted.

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…

And that creat has no e on the end.

It's a perfectly good word in Romanian.

Re: Dennis Ritchie’s first C compiler (c. 1972)

#97
post #60

Earlier quoted context omitted.

Float doesn't make sense either. What is floating? (I know it's floating point, but it's the same as long/double).

String doesn’t make sense either. But that’s how words acquire new meanings.

Well, 'character string' could, too, make a strange impression on an uninitiated.

Re: Dennis Ritchie’s first C compiler (c. 1972)

#98
post #66
post #42

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…

> 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…

Or ask a non-mathematician what a ring, a field, and a group are.

Re: Dennis Ritchie’s first C compiler (c. 1972)

#99
post #80

Earlier quoted context omitted.

It's short for "Hollerith string". Nobody wants to type out that man's name every time they want to deal with the data type. Also, most programmers know zero about computer science.

> Also, most programmers know zero about computer science. What made you say that?

I have known a very good programmer, I'd say one of the best I have met, and he had extremely, surprisingly little knowledge of computer science and math (not having a formal education may have been a contributing factor). He coded in JS and Ruby.

Re: Dennis Ritchie’s first C compiler (c. 1972)

#100
post #78

Earlier quoted context omitted.

Very interesting when you think about it. A language created in 2009 (Go) owes its syntax to a language from 1969 (B), and the latter looks like it does because it was designed during a short transition period between offline editing (1960s) and electronic terminals (1970s). And there are people claiming that computer scientists are not conservative :) To what extend this explanation is correct is another question...…

Actually the transition from "offline editing" and "electronic terminals" was not short at all. Teletypes (aka "typewriters which can recieve content encoded in electricity, next to the user keyboard") date back way beyond computers, and were still in use in the 1980s (but evventually superseded by fax). Teletypes were cheaper, faster and more convenient then video terminals. Don't underestimate of having a printout…

My first usage of a computer was on a printed teletype. My last such use was probably around 1985. They were around for a long time.
Post reply on HN