Live data from Hacker News

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

github.com

51–60 of 163 posts

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

#51
post #42

The original keywords - https://github.com/mortdeus/legacy-cc/blob/master/last1120c/... Interestingly, long was commented

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…

It could not be clearer that you didn't read the page referenced by the comment you replied to.

"long" was commented out.

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

#52

Earlier 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.

Was it different for the designers of ALGOL/SIMULA/Pascal?

Yeah, those languages were IIRC designed to be edited offline (as a deck of punch cards) and submitted to a mainframe via high-speed card reader as a batch job.

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

#56
post #31

Earlier quoted context omitted.

> No one has implemented a serious high level systems language, except in a high level systems language, for a long time now. LuaJIT is a prominent counterexample. The base interpreter in written in assembly for performance. It comes with its own tradeoffs, especially portability.

LuaJIT uses it's DynASM library for both static and JIT code generation. DynASM is implemented in a mixture of Lua and C, and Lua is of course implemented using C. So LuaJIT actually depends on a C compiler to generate assembly. Plus, not all of LuaJIT is implemented using assembly, only some critical hotspots (e.g. the bytecode interpreter loop). The rest is just C. DynASM is actually really cool. I almost forgot: a…

LuaJIT 1.x uses DynASM for JIT but LuaJIT 2.x doesn't and instead uses the IR to ASM compiler in https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/lj_asm.c

A program using DynASM doesn't depend on Lua or a C compiler to generate assembly at runtime but you need both to build it.

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

#57
post #20

I have to say, the way indentation and brackets were done here looks like it's just inviting subtle bugs. Take this for example: if (peekc) { c = peekc; peekc = 0; } else if (eof) return(0); else c = getchar();

If you can only read it line by line:

    return(0); else
makes a bit of sense.

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

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

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.
Post reply on HN