Top
Best
New

Posted by synergy20 10/24/2024

Pretty.c(github.com)
370 points | 221 comments
sneed_chucker 10/24/2024|
Creating DSLs within C has a long tradition.

Stephen Bourne wanted to write his shell in ALGOL so badly that he relentlessly beat C with its own preprocessor until it began to resemble his preferred language.

https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh...

sheepscreek 10/24/2024||
Here is an example of what we wrote using it:

https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh...

Keyframe 10/24/2024|||
This is not even half as bad as I expected it to be.
amy-petrik-214 10/25/2024||
excellent lore. said to have been the inspiration for the obfuscated C code contest.

https://www.ioccc.org/

codeflo 10/24/2024||
Can someone clarify whether this is intended as a joke or whether the author is actually confused? I mean, nothing about this makes sense: it's not "scripting"; it claims to introduce "strong typing" while it does nothing about typing; it introduces all kinds of operator aliases "modeled after Lua and Lisp" that are present in neither of these languages. But it's not an obvious parody either, so I'm genuinely not sure.
sandos 10/24/2024||
I mean he has to be serious, right: "Deprecate Lua, Python, JavaScript, Ruby and a dozen other languages, because Pretty C is the ultimate scripting language, but lightning-fast and strongly typed!!"
aartaka 10/24/2024|||
Author here. I don't see any problem with this
byroot 10/24/2024||
Well, as a starter C is rarely considered as "strongly typed". Statically typed yes, but strongly typed not so much.
aartaka 10/24/2024||
With C23 (nullptr, auto typing, typeof) and C11 (generics) it got more guarantees and type-related primitives. You can still do void*, but you are strongly discouraged from it.
byroot 10/24/2024|||

    #include "pretty.h"

    void print_int(int value){
        println(value);
    }

    int main (int argc, string argv[])
    {
        long value = 23849234723748234;
        print_int(value);
    }

How is this strongly typed?

    $ cc test.c -o test && ./test
    -1411401334
And to be clear, weak vs strong isn't a boolean property but a spectrum, but would be hard to argue with a straight face than C is a strongly typed language.
brabel 10/24/2024|||
C is likely the only example of a programming language that is clearly statically typed while at the same time being weakly typed. For a reason: as your example shows, it's a really bad idea (but understandable for a language from the 60's).
layer8 10/24/2024||
C is from the 1970s.

Java is weakly typed in its generics, despite being statically typed. I’m sure there are more examples.

brabel 10/25/2024|||
I don't think Java is weakly type even in generics. You can't "fake" your way with types like in C, you need to explicitly cast, which fails if you try to make an invalid type cast.
smithza 10/25/2024|||
The more pedantic compiler flags you introduce, the more strongly typed it becomes.
kazinator 10/25/2024|||
C is strongly typed in some areas in that ISO C requires a diagnostic if you mistakenly use a struct foo * where a struct bar * is required.

It's weak in many areas, such as, oh, that you can implicitly convert an out-of-range floating point value to an integer type and get undefined behavior.

Linkage in C is not type safe. An extern int x declaration in one translation unit can be matched with an extern double x = 0.0 definition in another. Linkers for c typically accept that without a diagnotic: the program links.

thiht 10/24/2024|||
That's pretty clearly said jokingly
AnthonBerg 10/24/2024||
I do not at all think the author is confused. Being confused is OK though.
nneonneo 10/24/2024||
It claims to be a scripting language but you still have to compile the programs. Boo! Add CINT (https://root.cern.ch/root/html534/guides/users-guide/CINT.ht...) and you can have instantaneous execution and even a REPL!
maccard 10/24/2024||
Given the idea behind this repo is to cause pain, why not add a shebang to your file [0] to make it executable.

I saw a blog post a long time ago that went into the details of how ./foo worked, and how it executed an elf file. You could register `.c` programs in the same way to be compiled and run?

[0] https://gist.github.com/jdarpinian/1952a58b823222627cc1a8b83...

nneonneo 10/24/2024||
Now I have a very evil idea: what about registering a binfmt handler for the header bytes “#include”? Sure, it doesn’t handle all C/C++ programs (notably any program that dares to start with a comment), but it would not require modifying any source code!

(For even more insanity I guess you could also trigger on // and /*, although there’s some risk of false positives then!)

shakna 10/24/2024|||
I'd prefer just using tcc [0]. Far lighter weight than that monster. And C, not C++.

[0] https://bellard.org/tcc/tcc-doc.html

suzumer 10/24/2024|||
Cern uses cling now (https://github.com/root-project/cling)
aartaka 10/24/2024||
Well, who said that scripting language cannot be compiled? And yeah, Clang-REPL is another way to make it REPL-friendly.
bityard 10/24/2024|||
Sure, there is no "rule" against it. But words/phrases have commonly-accepted meanings and willfully ignoring or appropriating those meanings implies either cultural ignorance or a concealed agenda.

If you want to insist that scripting languages can be either compiled or interpreted, then its better to just drop it altogether and just say "language" because the "scripting" part has utterly lost its identity at that point.

knome 10/24/2024|||
generally they aren't, as scripting usually implies an interpreter, though no one is stopping you from using a wrapping script that quietly compiles on first run and caches a bunch of executables somewhere. not much different than python producing bytecode files as it goes along.
randomdata 10/24/2024||
Script usually implies some kind of task that runs once and the exits. As opposed to a system that is expected to run indefinitely.

There are good reasons for why scripts are often interpreted and why systems are often compiled, but that's not what defines them. There are definitely scripts that are compiled and systems that are interpreted out in the wild.

knome 10/24/2024||
'scripting' is an ill-defined term with many interpretations, certainly.
randomdata 10/25/2024||
If that is the case, pick another interpretation and describe to us what "non-scripting" then might be.
knome 10/25/2024||
the original definition is likely tossing shell commands in a file to run later. chaining commands together. since perl and python supplanted this, they get lumped in as 'scripting languages'. both certainly can be used to write long running systems or short one off tasks.

compiled languages are rarely used for one offs because the effort they require is usually greater than the task calls for.

a big part of perl/python use is in tying together libraries written in more difficult lower level compiled languages.

you'll also see scripting used to refer to languages embedded in larger projects. lua scripts to control entities in a game, for instance. do they compile these somehow? I never did in the little project I used lua for.

----

all of that together, I expect that scripting as a concept largely boils down to conceptually simpler languages with less view of the ugly underbelly of how things actually work in a computer, used to chain together abstractions created by lower level code.

scripting is duct-tape. whether you duct-tape together a one-off task or some wad of long running functionality is besides the point.

randomdata 10/25/2024||
> you'll also see scripting used to refer to languages embedded in larger projects.

Yes, but this is conceptually exactly the same as the aforementioned shell scenario. This is not something different.

Just as I suspected, there is only one definition, and one that has proven to actually be well defined to boot as you managed to reiterate the only definition I have ever known to perfection.

kvirani 10/24/2024||
> Provide so much syntactic sugar as to cause any C developer a diabetes-induced heart attack.

Haha love this!

shakna 10/24/2024||
Well, there's a few things I should probably get around to adding to CNoEvil[0] and ogw[1]... There always seem to be more every few months when this project reappears.

[0] https://git.sr.ht/~shakna/cnoevil3/

[1] https://git.sr.ht/~shakna/ogw

cptnapalm 10/25/2024|
"It takes a whole lot of bad ideas and mashes them into an abhorrent monstrosity."

I love this to the very core of my being.

IgorPartola 10/24/2024||
For what it’s worth this makes the same mistake that Python 2 did: string and bytes are not the same type and shouldn’t be treated as such.
AlotOfReading 10/24/2024||
What do you consider the type of shell text, i.e. what's in argv and what you get from subprocess output? It's not well-formed utf8 strings because any random garbage can be in there, yet tools like awk and grep are ubiquitous.

I'd argue that strings and bytes are the same general type, but it's sometimes useful to give well-formed utf8 bytes a different type internally. Rust gets this mostly correct with OsString and String.

ryandrake 10/24/2024|||
The way I understand it: Bytes are just bytes, until you provide an encoding. Then they can be can be converted to a string, if validly encoded. Taking an array of characters and just treating it or casting it as a string is usually a bad idea.

The thing I think Rust maybe goofed, or at least made a little complicated, is their weird distinction between a String and a str (and a &str). As a newbie learning the language, I have no idea which one to use, and usually just pick one, try to compile, then if it fails, pick the other one. I'm sure there was a great reason to have two types for the same thing, that I will understand when I know the language better.

steveklabnik 10/24/2024|||
I wrote a blog post that may help you! https://steveklabnik.com/writing/when-should-i-use-string-vs...

If you want to understand more deeply, the Rust Programming Langauge, chapter 4, uses String and &String and &str to talk about ownership and borrowing. Here’s a link to the start of that chapter: https://doc.rust-lang.org/stable/book/ch04-00-understanding-...

ryandrake 10/24/2024||
How timely and helpful, thanks!

Your blog post is practical and clearly explains what to do, when, which is helpful. What's confusing is why Rust has the two types and why the language designers decided it was a good idea to have to convert back and forth between them depending on whether it was going in a struct or being passed as an argument. I suppose the "why" is probably better found in the Rust docs.

As a long-time C++ user, it seems like std::string vs const char* all over again, and we somehow didn't find a better way.

steveklabnik 10/24/2024|||
Yep, that’s exactly it: I wanted to focus purely on what to do, rather than weigh it down with what’s already in the Rust book.

It’s closer to std::string and std::string_view. But yes, in a language with value and reference semantics, when you also care about performance, you just can’t do any better: you need both types. Or at least, if you want the additional correctness guarantees and safety provided by communicating ownership semantics in the type. C gets away with just char * but then you have to read the docs to figure out what you’re allowed to do with it and what your responsibilities are.

umanwizard 10/25/2024||||
Rust has two different types because they are fundamentally different things, just like `std::string` and `const char *` are!

A pointer to some memory is not the same thing as a struct that has a pointer to memory, as well as a capacity field and the ability to resize itself.

AlotOfReading 10/24/2024|||
In C++ terms, String is std::string, &str is std::string_view. They're different things, but they can appear similar.
brabel 10/24/2024||
A Rust `String` reference (i.e. &String) can always be passed where `&str` is expected because `String` has a `Deref<Target=str>` impl... in that sense they don't just appear similar, they are polymorphic.
AlotOfReading 10/24/2024||||
There may not be a single encoding for every byte in a string. The encoding may not be knowable ahead of time. You might be trying to extract strings from a random blob of bytes with unknown origin. There's a thousand and one different variations.

To give a real example, I once wrote some python scripts to parse serial messages coming off a bus. They'd read the messages, extract some values with regex, and move on.

Unfortunately the bus had some electrical bugs and would intermittently flip random bits with no CRC to correct them. From my point of view, no big deal. If it's in something outside the fields I care about, I won't notice it. If it's flipped something I do care about we have a bad sample to drop or noise the signal processing will deal with. Either way, it's fine. Python on the other hand cared very much. I rewrote everything in C once I got sufficiently annoyed of dealing with it and more importantly explaining to others how they couldn't "simplify" things using the stdlib APIs.

ptspts 10/24/2024||
Python stdlib conveniently supports both byte strings and Unicode strings, even for regexps. Ther is no need to migrate to any other language.
umanwizard 10/25/2024||||
String in rust is roughly like this in C:

  // NB: Must be utf-8!
  struct string {
    size_t sz;
    size_t capacity;
    unsigned char *buffer;
  };
&String in Rust is roughly like `const struct string *`.

str in Rust is just an array of (guaranteed utf-8) unsigned bytes. It does not have a capacity, so it can't be resized. You can't directly construct one (on the stack), because its size is undetermined and Rust doesn't have dynamic-sized stack allocation.

&str, and Box<str>, are pointers to str, along with a size, and are roughly like this C:

  // NOTE: Must be utf-8!
  struct str_ptr
  {
    size_t sz;
    unsigned char *buffer;
  }
The difference between &str and Box<str> is that the latter is an owned pointer to a heap allocation which will be freed when it goes out of scope. &str is unowned and might point anywhere: to a Box<str> on the heap, to a String on the heap, or to read-only static memory.

IMO, it's probably easier to first try to understand the difference between `Vec<u8>`, `&[u8]`, and `&Vec<u8>`, because they are slightly less "weird" than the string types: they aren't syntactically special like `str` is[1], and they don't have an implicit requirement to be utf8 that is inexpressible in the type system.

[1]: `str` is syntactically special because it is basically a slice, but isn't written in slice notation.

paledot 10/25/2024|||
String/str are both valid UTF-8 by definition, though. Plain ol' piles of bytes in Rust are generally represented by Vec<u8>/[u8].

Rust could have done better in naming, but a definite design goal of the language (for better and worse) is to not make things that are complicated for the compiler appear simple to the user. Which unfortunately results in:

    String/str
    CString/CStr
    OsString/OsStr
    Vec<u8>/[u8]
    AsRef<str>
    Cow<`a, str>
IgorPartola 10/25/2024|||
What you see on the screen of a terminal is Unicode strings. It is human readable text. len(“”) is 3 even if the underlying encoding holds it as 6 bytes.

Of course if you provide a separate set of functions for treating a string as human readable vs not you can also work with that. Basically len() vs byte_len().

But you can’t concat two human readable strings without ensuring they are of the same encoding. You can’t search a string by bytes if your needle is of a different encoding. You can’t sort without taking encoding and locale preferences into account, etc.

Pretending like you don’t care about encoding doesn’t work as we have seen time and again.

michaelsbradley 10/24/2024|||
Given the nature of it (pretty.c) and the stated intention of being "backwards-compatible with C and all of its libraries", what would make more sense than sticking with C's multibyte strings?

https://en.cppreference.com/w/c/string/multibyte

IgorPartola 10/25/2024||
Right but pretty.c doesn’t seem to explicitly support those.
michaelsbradley 10/25/2024||
How so? it’s just char*
IgorPartola 10/26/2024||
What if len() of a char* vs a Unicode string?
michaelsbradley 10/26/2024||
char* is just raw bytes.

At the language level C historically hasn't offered much support for working with specific character sets and their encodings. With C17 and C23 we get u"...", U"...", u8"...", type char8_t, and similar, but there's still little/no built-in tooling for text processing.

For text processing work with char* whose bytes are some encoding/s of Unicode, e.g. UTF-8, then you an use a C library such as libunistring or ICU.

However the bytes of a char* could instead be an encoding of a non-Unicode character set, e.g. GB2312 encoded as EUC-CN.

So char* is character set and encoding agnostic. And C-the-language doesn't even try to offer you tools for working with different sets and encodings. Instead, you can use a library or write your own code for that purpose.

A number of languages make the same decision, keeping the string type set/encoding agnostic, with libraries taking up the slack.

In Nim, for example, the string type is essentially raw bytes (string literals in .nim sources are UTF-8). If you're doing Unicode text processing then you'd use facilities from the std/unicode module

https://nim-lang.org/docs/unicode.html

Same story with Zig

https://ziglang.org/documentation/0.8.0/std/#std;unicode

Lua too, and you'll probably use a 3rd party library such as luaut8 for working with Unicode/UTF-8

https://github.com/starwing/luautf8

Returning to the matter of pretty.c, since it's just sugar for C, it makes sense (to me) that the string type is just an alias for the set/encoding agnostic char*. It's up to the programmer to know and decide what the bytes represent and choose a library accordingly.

samatman 10/24/2024|||
I don't agree. This doctrine presumes all of the following:

  - String data will be properly encoded
  - There is one encoding of strings (UTF-8 usually)
  - Validation must occur when string data is created
  - Truncating a logical codepoint is never acceptable
  - You may not do string things to "invalid" bytes
  - Proper encoding is the beginning and the end of validation
None of these things are consistently true. It's a useful practice to wrap validated byte sequences in a type which can only be created by validation, and once you're doing that, `Utf8String` and `EmailAddress` are basically the same thing, there's no reason to privilege the encoding in the type system.
IgorPartola 10/25/2024||
I mean other languages make it work.
umanwizard 10/24/2024||
What is your definition of "string"?

If it's "human-readable text", then fine, a string is not the same thing as an arbitrary byte array.

But lots of languages don't enforce that definition.

bobbylarrybobby 10/24/2024||
Well that's the very thing: not enforcing that distinction is the very mistake in question.
gpuhacker 10/24/2024||
Reminds me of a C++ codebase I once had to inspect that was entirely written as if it were written in Java. With camelcase naming for everything, getters and setters for every class variable, interfaces everywhere.
jart 10/24/2024||
You ain't seen nothin. Check out the bourne shell source code from unix seventh edition. https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd... I can't believe it's not ALGOL.
froh 10/24/2024|||
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd...

wow.

thanks for this gem.

teruakohatu 10/24/2024|||
Wow, I was not expecting that! Was this style of C common back then?

Before he wrote the Bourne shell the author wrote an ALGOL compiler, and ALGOL inspired Bourne syntax:

https://en.wikipedia.org/wiki/ALGOL_68C

pasc1878 10/24/2024||
There were article suggesting #define BEGIN { and #define end }; to make C look more like Pascal.

I think in Europe C was not as common as other languages at the time so the terseness looked odd.

pavlov 10/24/2024||
Also because the special characters were (and are) difficult to type on European keyboards.

Characters like []{}\|~ are behind multi-finger access and often not printed at all on the physical keys (at least in the past). You can see how this adds a hurdle to writing C…

Pascal was designed by a European, so he preferred keywords which could be typed on every international keyboard. C basically just used every symbol from 7-bit ASCII that happened to be on the keyboards in Bell Labs.

smatija 10/24/2024|||
Just as example, on my slovenian QWERTZ layout: [ - altgr+f, ] - altgr+g, { - altgr+b, } - altgr+n, \ - altgr+q, | - altgr+w, ~ - altgr+1.

You get used to them, though you start feeling like a pianist after a short coding session. The one most annoying for me are the fancy javascript/typescript quotes, which I have to use all too often: ` - altgr+7.

ulbu 10/24/2024||
Today I learned that there exist people who use non-US layouts when coding. That’s spectacular!
smatija 10/24/2024|||
I tried switching to US a few times, but every time muscle memory made me give up soonish - especially since there are big benefits to using same keyboard layout as other people in your office are using.

Also practically everytime I need to write a comment, commit message or email I need my č, š and ž. It's kinda nice to have them only a single keypress away.

oezi 10/24/2024|||
My hack: use caps key to switch to local keyboard layout while holding it.
dagw 10/24/2024||
Love it! I use ctrl+space to switch, but your idea sounds even better
pavlov 10/24/2024||||
How did you think people outside the US learn programming?
ulbu 10/25/2024|||
I'm from a non-English country. I only ever use layout of my locale when I write in my language. That's how it was ever since I was a kid who knew little English. And that's how all computers I've encountered in my country are set up - English first, local second.

In addition, our layout, overwrites only the numerics – all other symbols are the same as on a US layout.

anthk 10/24/2024|||

              setxkbmap us -option ctrl:swapcaps -option compose:rwin
Problem solved. US layout, and with the right Window keys you can compose European characters.
pavlov 10/24/2024||
There’s so many assumptions here about a person who’s starting to learn programming.

For starters, that they’re on Linux, they feel comfortable running complex CLI commands, they can memorize the U.S. layout just like that, and that they can type without looking at the physical keys (because changing the virtual mapping means keys produce something else than what the label says).

In reality, the learner’s first exposure to C family languages is more likely to be a website where you can run some JavaScript in a text box. And the first hurdle is to figure out how to even type {}. American developers just completely forget about that.

ulbu 10/25/2024|||
Installation of Windows and MacOS defaults to US + local layouts.
anthk 10/24/2024|||
On the long term, using the native keyboard hinders yourself a lot. I tried to do so with the Spanish (es) layout, it's pretty much unergonomical.

It's looks like being deliberately designed for press/office usage and not for proper programming.

pavlov 10/24/2024|||
I’ve been writing C and its progeny (C++, JavaScript, Rust etc.) since 1990 on a Finnish keyboard.

The AltGr brackets are fine. The truly annoying character to type is the backtick (which is a quite new addition to the pantheon of special characters, C doesn’t use it).

My personal opinion is that Niklaus Wirth had the better overall ideas about clarity and inclusiveness in programming language design, but that battle is long lost. (What you consider the character set needed for "proper programming" is really a relatively new development, mid-1990s and later.)

schoen 10/24/2024||
Backticks were fairly important for shell scripting in the past, but have officially been replaced with $(), which can be nested.

My intuition is that Perl would be the most challenging on a keyboard where it's harder to type unusual punctuation, since it feels like a very punctuation-heavy language, but I don't know whether it actually uses more than C (I think the backtick has a shell-style meaning in Perl too).

psychoslave 10/24/2024||||
>it's pretty much unergonomical.

Well unless opting for something like Dvorak, you are indeed doomed to something that was specificcaly designed to please typewriter mechanical constraints without much care for the resulting ergonomics.

I use a Bépo layout personally, on a Typematrix 2030 most of the time, as French is my native language.

SSLy 10/24/2024|||
or maybe popular proglangs were designed for writing on USAn press/office keyboards – remember that UNIX came to be as a typesetting appliance — disregarding anyone else.
cryptonector 10/24/2024|||
Spectacular?? Terrifying. If I need to type non-ASCII Latin characters I'll just use compose sequences. The thought of a non-U.S. keyboard layout with modifiers required to type []{}<> and so on is terrifying.
fuzztester 10/24/2024|||
IIRC, Pascal had/has (* and *) as an alternative to { and } , from the start, or from early on - as syntax for start comment and end comment.
worstspotgain 10/24/2024|||
> camelcase naming for everything, getters and setters for every class variable, interfaces everywhere

This is not far off from the guidelines in many cases, e.g. Windows code (well, not every variable of course.) A lot of Java design was copied from C++.

rauli_ 10/24/2024|||
I've seen similar codebases as well written by people who have spent way too much time with Java. One even had it's own String class which was just a wrapper for std::string with Java-like methods.
bpye 10/24/2024|||
Good job they weren't using MSVC I guess...

https://learn.microsoft.com/en-us/cpp/cpp/property-cpp?view=...

pasc1878 10/24/2024|||
I had that as well but also Java passes strings in as f(String *) so the C++ code was f(new String("Hello")
shortrounddev2 10/24/2024||
I think that's just OOP
aartaka 10/24/2024||
You might like https://aartaka.me/oop-c
SSLy 10/25/2024||
oooh that was your creation. it makes (barely, I'm stupid) sense now
Alifatisk 10/24/2024||
If you find this interesting, you might like libcello.h aswell! https://www.libcello.org
aartaka 10/24/2024|
Yes, it's one of the inspirations!
Uptrenda 10/24/2024||
Type names are nice; Perfect choice for the in-built func macros (like min); Len -- love it. Named boolean operators -- might be a bit much but go for it; Ternaries are illegible so you can only improve them; Not completely sold on all your loop definitions but some make sense to me; Resource tracking is impressive; The for... look a bit ugly -- could probably call it something else.

All in all: quite a solid attempt. I'll give you 8/10 for the design of this. The way you sketched this out in C using macros is really elegant. This actually looks like good code. Would I use it? It's a new language and I like C already. It could help people learn C and think about language design. Since the way you've done this is very clear.

aartaka 10/24/2024|
Well, you don't have to use it all. My projects mostly use booleans, len(), max/min, and some operator aliases, because there wasn't much need for other tasty stuff yet. So give it a shot, even if for a couple of operator macros!
Uptrenda 10/24/2024||
You know I expected your macro file to be unreadable moon math. But it actually doesn't look bad.
tromp 10/24/2024|
> ifnt for if(!...).

"unless" seems more readable than "ifnt".

tux3 10/24/2024||
Another bikeshed is the infinite for(;;) loop being called "always"

I've seen "loop" in other languages. But Qt calls it "forever", and that is indeed very pretty. Very Qt, even

poincaredisk 10/24/2024|||

    #define ever ;;
    for(ever) {}
codetrotter 10/24/2024||

    #define never ;0;
    for(never) {}
metalliqaz 10/24/2024||
for(evernt) {}
teruakohatu 10/24/2024||||
> I've seen "loop" in other languages. But Qt calls it "forever", and that is indeed very pretty. Very Qt, even

You can break a "forever" loop so I think "loop" is a better name.

wwalexander 10/24/2024|||
I don’t know why “repeat” isn’t very common in place of while/loop/etc; it works out nicely grammatically.

    repeat {}
    repeat while <condition> {}
    repeat {} while <condition>
    repeat <count> {}
af78 10/24/2024|||
One possible reason:

> The word "REPEAT" should not be used in place of "SAY AGAIN", especially in the vicinity of naval or other firing ranges, as "REPEAT" is an artillery proword defined in ACP 125 U.S. Supp-2(A) with the wholly different meaning of "request for the same volume of fire to be fired again with or without corrections or changes" (e.g., at the same coordinates as the previous round).

https://en.wikipedia.org/wiki/Procedure_word#Say_again

More seriously, PASCAL has repeat-until loops, similar to do-while loops in C.

aartaka 10/24/2024|||
Pretty C does aliases "repeat" for "do", so yeah, I've got you covered!
krylon 10/24/2024||||
"indefinitely" might be a better name. (But I think loop is indeed a better name.)
aartaka 10/24/2024||
Added in commit ef510ca!
layer8 10/24/2024||
I hope you also add a “definitely”, for symmetry.
aartaka 10/24/2024|||
"loop" added in commit 626408b, thank you!
aartaka 10/24/2024|||
"forever" added in commit 67ff9ef, thank you!
cdcarter 10/24/2024|||
On the other hand, ifnt is fun to say outloud.
aartaka 10/24/2024||
Indeed! But I've reserved "unless" for a ternary conditional, which is more useful anyway.

Oh shit wait, you're John Tromp, BLC creator! I'm a fan!

More comments...