Use ASV #2

Open
opened 2025-03-19 00:58:53 -06:00 by emma · 4 comments
Owner
See https://git.tebibyte.media/bonsai/harakit/issues/19
Owner

fortune(1) should keep using the format it always has. There's no reason to change it, we have files written for it, and it keeps interoperability with other implementations.

fortune(1) should keep using the format it always has. There's no reason to change it, we have files written for it, and it keeps interoperability with other implementations.
Author
Owner

We have a character set specifically catered to use in this context. We
have the luxury of not having to worry about breaking compatibility
because we are a cohesive system and there is a native tabular format
that is specifically designed to circumvent weirdness like using a
percent sign as a tabular character.

As a note, 9front’s fortune(1) implementation seems to work differently
to how Unix fortune(1) does. It has no percent characters as far as I
can see.

We have a character set specifically catered to use in this context. We have the luxury of not having to worry about breaking compatibility because we are a cohesive system and there is a native tabular format that is specifically designed to circumvent weirdness like using a percent sign as a tabular character. As a note, 9front’s fortune(1) implementation seems to work differently to how Unix fortune(1) does. It has no percent characters as far as I can see.
Author
Owner
https://git.9front.org/plan9front/plan9front/c813cfa1981b3566a34b4d614fa5ec2aaee53819/sys/man/1/fortune/f.html > prints a one-line aphorism chosen at random. I was correct.
Owner

9front's format is the same as the historical implementation; if I recall correctly the first implementation used a 500B buffer and looped fgets(3) randomly. The percent delimiter might have been a BSD invention. It's nice to be able to see the sources for quotes without bad line-wrapping.

We have the luxury of not having to worry about breaking compatibility

We don't exist in a vacuum. There already exists two fortune file formats. I don't want to invent a third.

weirdness like using a percent sign as a tabular character

ed(1) used \n.\n to cease input. \n%\n fits with that pattern. It's not like % as a single fortune is useful.

9front's format is the same as the historical implementation; if I recall correctly the first implementation used a 500B buffer and looped fgets(3) randomly. The percent delimiter might have been a BSD invention. It's nice to be able to see the sources for quotes without bad line-wrapping. > We have the luxury of not having to worry about breaking compatibility We don't exist in a vacuum. There already exists two fortune file formats. I don't want to invent a third. > weirdness like using a percent sign as a tabular character ed(1) used `\n.\n` to cease input. `\n%\n` fits with that pattern. It's not like `%` as a single fortune is useful.
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bonsai/fortune#2
No description provided.