The original Bourne shell was written in a *very* strange style of C, which shows that even in 1979, some of the original Unix greats disdained C's famed terseness & wanted _keywords_ instead of punctuation marks.

TIL it has a name: it's known as "Bournegol".

https://oldhome.schmorp.de/marc/bournegol.html

Marc Lehmann's "Bournegol Page"

Bournegol

@lproven cursed C. 😱

@ivor @DrHyde

"Actually, I quite liked it," said Arthur brightly.

Include C language instructions in documentation Β· DrHyde/configurations@f96fca3

Add language-specific instructions for C programming.

GitHub

@ivor @lproven

Well if you want cursed c you have Arthur Whitney's c coding style :p

https://needleful.net/blog/2024/01/arthur_whitney.html

Learning to read Arthur Whitney's C to become Smart - Needleful.net

it's not working

@ivor @lproven that opens up so many misrepresentations: Curse++, Curs#.
I was aghast by a joke: C my Python, just a few days ago.

@twosky2000 @ivor

Now TBH I'd have gone with "C monster" or "C serpent" or something along those lines... But your version does allow for more follow-on gags...

@lproven pre-ANSI C is weird anyway, but ... AAAARRGRGGGHHHHH MY EYES ARE ON FIRE
@lproven I have to deal with pre-ANSI C often enough, and have tripped up on some subtle edge cases, that I keep both editions of K&R handy

@DrHyde @lproven

I have written real code in BCPL and pre-ANSI C is a pure and perfect gem by comparison. The only major syntactical problem in classic C is the prefix pointer indirection operator.

@resuna @DrHyde

The mere fact that C is bad does not preclude the possibility that its ancestors may not have been even worse.

@lproven @resuna @DrHyde I used to teach a course that was nominally students' second exposure to (modern-ish) C and as a result I have a damn *list* of its syntactic design errors, most of which go all the way back to the original.

@zwol @lproven @DrHyde

There are some issues but at least they swapped equals-minus to minus-equals. Octal constants are a niggling annoyance. But the only critical mistake I think was making pointer indirection prefix. Most of the other syntactic difficulties are consequences of that. I discussed it briefly with Dennis at Usenix and he said that they had thought about changing it but by that time they had three sites using C and they thought it would be disruptive.

@resuna @lproven @DrHyde Yeah *some* of the problems would go away with postfix pointer dereference, but the inside-out complex declarator structure, the fact that "struct X { ... };" and "struct { ... } X;" are both valid and mean two very different things, and the excessive number of operator precedence levels have nothing to do with pointers. Just to name three.

@zwol @lproven @DrHyde

The inside out type declaration is due entirely to the prefix pointer dereference.

@resuna @lproven @DrHyde Not true. `int (fptr*)(int)` is not an improvement on `int (*fptr)(int)`.

@zwol @lproven @DrHyde

int fptr*(int);

Making both pointer and function indirection postfix means you don't need (all (the (extra) parens)). It's not "inside-out" any more. It's linear.

@resuna @lproven @DrHyde The name of the declarand is still in the middle, and you have to read first to the right (for the arguments) then to the left (for the return type) and THEN back to the middle (asterisk means it's not a function but a pointer TO a function being declared).

That's the inside-out-ness. That's what confuses students the most.

To not be inside-out, it would need to be something like `var fptr: *((int) -> int)` or `var fptr: ((int) -> int)*`.

@zwol @resuna @lproven @DrHyde the committee would later duplicate this madness with const, which is prefix most of the time.

@vathpela @resuna @lproven @DrHyde People tend to *write* qualifiers as if they're prefix but they are actually *parsed* as "postfix unless there isn't anything to the left to qualify, in which case prefix".

Sorry if I'm telling you something you already know. I have had to write a full parser for C declarations, from scratch, twice, and debug other people's attempts more times than I can remember.

@zwol @resuna @lproven @DrHyde yeah, it's just that it'll drive you crazy when trying to deal with const pointers. Just a wild choice.

@zwol @lproven @DrHyde

So you're actually saying it should be "var fptr*(int) -> int;"

I can see an argument for that but it's practically syntactic sugar, it's a much smaller issue than having to disambiguate "*fptr(int)" with "(*fptr)(int)". Prefix pointers require you to continually switch from left to right over and over again as you parse the expression.

@resuna @lproven @DrHyde I give up. I don't know how to make you believe that the C declarator syntax requires people to read back and forth and back and forth *even when no pointers are involved* and it's one of the most common things for people who are just starting to learn C to struggle with.

@lproven @DrHyde

The only differences between C declaration syntax and any other algol-derived language are the type name being at the front instead of the end, and the mess created by having indirection operators with two different syntaxes.

@resuna @lproven @DrHyde I *said* I give up. Please stop.
@zwol @resuna @lproven ugh, precedence. People moan at me for using unnecessary parentheses. They are wrong.
@zwol @lproven @resuna does the list start with "literally everything to do with pointers"?
@DrHyde @lproven @resuna Semantic design errors are a separate list.
@lproven so, C but it reads like SQL
@ZanaGB @lproven SELECT curse FROM antiquity
@f4grx @lproven WHERE `legibility` IS NOT NULL
ORDER BY `keyword_length`;

@ZanaGB @f4grx

So does that imply

IF LEN(keyword) = 1 THEN legibility = 0

...?

Because personally that's always how I've found the curly-braces languages. SPELL IT OUT you lazy b@st@rds. What's the matter with you, can't you smegging well type?

@lproven i suppose it depends, what kind of model of program structure do you want your syntactic-assembly-instructions (the { and endif and so on) to imply?

keywords imply to me

while_start(); // push evaluator state
while_cond(expr);
// ... work
while_end(); // jump or pop

where keywords indicate a state-modifying instruction

braces imply to me

fnwhile(^{ return expr; }
, ^ {
// ... work
});

where control structures are syntax-time operators that accept blocks as their operands

both models have their place
personally i have come around strongly to the second because it seems more composable and abstractable (i.e. you can define "higher order" controls that take the control operator and apply blocks to it)
which is useful specifically because that's what i like to do, maybe not what others want to do

@ZanaGB @f4grx

@erisceleste @lproven @f4grx

We personally love a very verbose way of laying down instructions. But then again a lot of our work is basically functional with little to no objects in place. So perhaps not as abstracted as some people. so having your BEGIN FOR, END WHILE, IF, CASE, DO, etc etc, and other, almost SQL-isms are neat.

Your first example is easy to figure out what it might be doing. your last example is pretty much just soup to our eyes (also is that a return type declaration or the variable to return at the end of the function? etc etc).

A lot of people do rave about natural language programming but honestly, just having actual readable words for what you're doing even if you're doing verbose assembly would be good. ( but, again, it is not the same to stuff some values into some registers to have a little bunny move across a 32 tile playfield than it is, temperature monitoring for blood samples or what have you)

@lproven @f4grx

Yeah, continuing with the joke... yeah. having explicit keywords that separate instructions and loops is better than semicolons, curly braces or counting whitespace.

@ZanaGB I don't want to be annoying, so feel free to ignore if that's better for you, but I'm always interested in how the whitespace thing really divides people. Sometimes I feel like I get a glance at an underlying reason of why people don't like it. I feel like there is some profound insight into individual cognition behind it, that's so obvious that we can't see it. When you say "counting whitespace", it's a phrase that completely confuses me. What do you mean by this?

@tartley Bad eyesight, dyslexia, and a love for using narrow windows with big fonts (so multi-lining sentences is often a thing) as well as mixing tabs and spaces for readability/aesthetic reasons.

Gauging horizontal distances is really hard for us, and we also tend to write in... very a disorganized and spur-of-the-moment fashion. PHP and C# with their semicolon, parenthesis and curly brace soups end up giving a lot of issues specially if you try to break down long operations, or simply end up shuffling your logic around much as you figure out what's up.

Python and the like have no delimitators and calculate nesting by the amount of leading whitespace.

Is it bad? it probably is not.

As some people above say, it's an indicator of less experienced developers who can't handle twenty layers of abstraction... So be it. It might be that on our day job we spend so much time staring at SQL sentences we appreciate having keywords for everything, but being able to EXPLICITLY read, not figure which one of the curly braces it belongs up or disappear into the background of the editor, or trying to follow with an expand/contract crutch to see where it ends, where it starts and figure you nested things correctly. And this is all whining and moaning and bitching and semicolons, curly braces and parenthesis, things that "are there" even if they can be blurry and low contrast and literally vanish from your eyesight.

Now imagine doing that with whitespace.

Up to you. is our experience statistically significant or such a fuck anomaly it shall be discarded? Not our position to judge. But we would really love to have more explicit keywords to help us figure where the hell are we on our own code. (hell, explicit BEGIN/END+(name of the thing) tags instead of curly braces would do wonders already for legibility[END IF/END FUNCTION/END ARG-LIST/etc.])

@ZanaGB thank you SO MUCH for that rich and vivid account of your perspective. While I have my own preferences that it sounds like are different from yours, I'm very strongly in favor of accommodating whatever people need or prefer, and this is one issue that I really have struggled to even understand it, but you've made it very clear. Thank you for helping me understand.
@ZanaGB I'm reminded of some old LISP ideas, wherein it's very easy to deeply modify the language itself, and so a few lines of code can allow the rest of your program to be expressed using traditional structural parentheses, or significant whitespace, or keywords, or however you prefer. Arguably these superficial concerns should be customizable for each programmer.

@tartley Most people who hate python hate it because C and C-Likes are all they know and they think anything without their esoteric symbols is sacrilege. People get oddly aggressive about it for some reason (and we got in many a fights due to our wish for more syntactic sugar). So do take our lack of enthusiasm about whitespace-gauging in the context of probably being against the grain due to physical issues.

In our case it boils down to the inability to see properly, and being frustrated trying to figure out where things are (pardon the swearing earlier, BTW).

There's probably editors out there that will do stuff similar to how VSCode would paint matching semicolons the same colour so that you can see which blocks of code belong together by the whitespace alone (and if nobody has done there's a free idea). But yeah. Nothing against python or it's whitespace. We just can't bloody see it haha.

And yeah, LISP and a lot of the early languages seem like they wanted to put a lot of emphasis on flexibility and letting people be more in control of what they wrote. But eventually optimizing for the compilers won, it seems.

But, yeah, hopefully this helps!

And well, have a bun for your troubles! hope this is not a lot of blabbering! (not our bun but still an accurate representation of the other end of the line)

@lproven @ZanaGB @f4grx Fun fact: there's a CS ed paper claiming that beginners do indeed find block structure keywords easier to grok than either curly braces or indentation-only. I recall having quibbles with some of their experimental design but I think the basic result is probably correct. It fits with what I saw when teaching, anyway.

(Regretfully, don't ask me to come up with an actual citation, I read this paper more than ten years ago.)

@zwol @lproven @f4grx Yeah that is a fun fact

Honestly though.

So many codebases devolve into curly brace soup it becomes beyond annoying. Specially when you get to inline functions abusing ternary operators as your method's entry parameter.

Mouse (programming language) - Wikipedia

@lproven

I had fun making my own after playing around with Bournegol a bit.

https://git.sr.ht/~shakna/cnoevil3/

@shaknais

Looks all right to me.

Can I send a PR over activitypub?

In:

https://git.sr.ht/~shakna/cnoevil3/blob/refs/heads/master/LICENSE.md

Replace:

> in it's nature

with:

> in its nature

@lproven

Merged. And making me want to see if a git-mail-send like client via activitypub would be fun to actually make...

https://git.sr.ht/~shakna/cnoevil3/commit/d37c3ee045b478a939af783acac955466d8fbcde

@lproven Your url simply forwards to anthropic.com//0.2784308762879… for me ... which just gives "not found" in plaintext .. mh πŸ˜€ (and the number changes with each request..)

@hackbyte

This one?

https://oldhome.schmorp.de/marc/bournegol.html

🀷

Works on my machine.

Marc Lehmann's "Bournegol Page"

Bournegol

@lproven Yes, exactly that one .... aaand fu .. weirdly, in 2 chrome variants, one a bit outdated, i have the same result..

In firefox it works..... in chrome, a few seconds long loading delay and then it switches to sauid antrhopic.com url .....

And no, i have definitely no local AI stuff installed .... very weird.