I wonder how much of C behavior is really explained by Dennis Ritchie and Ken Thompson either disagreeing about something or just not feeling like doing something different at the time.
-
I wonder how much of C behavior is really explained by Dennis Ritchie and Ken Thompson either disagreeing about something or just not feeling like doing something different at the time.
-
JohnMasheyreplied to Scott Williams π§ last edited by
@vwbusguy
Which specific examples did you have in mind? -
Scott Williams π§replied to JohnMashey last edited by
@JohnMashey There have been a few conversations going on today on Mastodon, but the most recent one I saw was this one:
Kanashimia (@[email protected])
Attached: 1 image @[email protected] Were there any proposals about allowing to initialise arrays from other arrays in C? Not just from initialiser lists or w i d e string literals. It is quite stupid that you still can't do this. It is just a cruft that was left by B language in 1969 (nice (not)). I mean yeah, I can use memcpy, but this is the only place were it is needed, it is just plain annoying. Like look I have this one pretty big struct: https://infosec.exchange/@kanashimia/113059468000022921 It is very big, it is so big that it doesn't fit on my 42 inch TV that I use as a monitor, and it is amazing, it is humongous, I like it very much. But it contains arrays that I must initialise from other arrays. It was annoying so I invented a macro that expands to int b[2] = { a[0], a[1] }; I mean YOU CAN initialise arrays from other arrays, just in the most stupid way possible with macro hacks or by typing that inanity out yourself. Good luck inventing a macro that works on arbitrary dimensions and nestings, also you need to know your length at the preprocessing time. For C with its /amazing/ third class behaviour of arrays, it could only ever be solved in the most stupid way, like by adding some builtin or something I imagine, so want to hear what discussions were there if any. Yeah, maybe this is not important at all or whatever, and REAL 100% programmers don't need this, but still, thoughts? BTW I liked your blog posts very much.
Infosec Exchange (infosec.exchange)
-
<?xml version="2.0"?>replied to Scott Williams π§ last edited by
@vwbusguy I'd go back in time just to bitch slap Ritchie so he could go back to the drawing board and maybe reconsider if he should make Unix at all (or at least C, but you know, one thing leads to another)
-
Scott Williams π§replied to <?xml version="2.0"?> last edited by
@overanalytcl I actually think Unix and C are both petty neat and appreciate their contributions. Unix and C have both far exceeded their original anticipated scope.
-
Scott Williams π§replied to Scott Williams π§ last edited by
@JohnMashey Also just musing to myself about the extent that Conway's Law may have applied.
-
JohnMasheyreplied to Scott Williams π§ last edited by
@vwbusguy
Many decisions were of course driven by minimalism, by both ken+dmr philosophy and computer constraints. PDP-11/20: macx 56KB, shared between kernel and user (before my time). PDP-11/45 was real upgrade to 248KB max physical memory, but with real MMU allowing both kernel and users to each have 64KB I + 64KB D. Still not huge. Had they gotten PDP-10 they wanted, UNIX and C likely donβt happen:
https://techviser.com/wp-content/uploads/2022/06/Mashey.IEEE_.Micro_.2022.pdf -
@vwbusguy
And yes, Conway's Law applied (3rd bullet pt is extended variant, in talk first done in 1977. Ken+dmr were both fine computerscientists & incredsible programmers, but definitely minimalists, and with2 people doing a kernel, all that showed.
https://www.usenix.org/legacy/events/bsdcon/mashey_small/sld026.html