the scary thing about is when in file formats it has stuff like:

file: refers to a file
some-special-string: does a special thing

and that just invites the problem of someone using some-special-string as a file name

pls, anyone who does
do not ever do anything like this
keep your formal grammars unambiguous

if you do not, Ada Lovelace will come down from Programmer Heaven and smite you


@Shamar idk, read it in some manpage the other day, not sure which
but similar problems apply to a lot of the system, eg. how basically nothing can handle spaces in file names

(hot take, $ifs should only contain tab and newline, or better yet, there should be no $ifs)

Β· Web Β· 1 Β· 0 Β· 0

@Shamar this isn't really a Plan 9 specific problem, but it's one of those things that mess up an otherwise nice system

@Shamar @xj9 You only can't use 0x0 because of C's limitations. :blobshrug:
IMHO, type Path = List String (maybe NonEmptyList or something) makes more sense than using char*.

It makes sense in historical context, sure, but it doesn't have to always be like this.

And not all limits make you think, some are just practical because an upper bound is often nice to have. Eg. 255 characters per file name is probably a relief for on-disk file system formats.

@Shamar @xj9 Software isn't special in this regard btw, every protocol works like this. They restrict things so that other (hopefully useful) things can happen more easily.

@Shamar @xj9
So it's a chosen limitation. That doesn't change much.
Other choices might make more sense now.

@Shamar @xj9 Easier programming IMHO. I want users to be able to do shell programming without the usual pitfalls. If that means patching coreutils to work on s-expressions or whateve, so be it.

@Shamar @xj9
I mean, you can use Lua in Acme and it's like... fine. Having a proper encoding just makes things easier.

eg. linear TSV is pretty nice and simple and you don't need to fully parse it to split fields, because tabs are always escaped

@Shamar @xj9

Like, just having a standard lightweight container format would be enough, so you don't end up writing a parser for every tool.

TSV is nice because you can write an en/decoder in an hour (at most, if your C is rusty. more like 15 minutes otherwise) and it gets you enough structure without sacrificing readability

pure S-expressions are also super easy to parse, just need like... a way to do recursion??? i think? it's been a while since I wrote one (in Lua) but that too only took like 20 m.

@Shamar because they are useful

the question is, why would tools use space as a primary field separator

@Shamar like, if you wanna give files meaningful names, you're gonna use spaces

hyphens don't cut it (they have different semantic meaning in language) and underscores are irritating to type and look ugly

@Shamar @xj9 This is the same argument people (used to) use to defend ASCII-only systems. :blobshrug:

@Shamar @xj9
Or just.... force users to use string literals for strings? And let unquoted strings mean something else?

I mean, you can't seriously say "but that's harder to learn" when we have just demonstrated how many problems it leads to.

If kids can learn Python in a week, programmers can bear with a teeeensy bit more syntax in their shells.

Sign in to participate in the conversation

Cybrespace is an instance of Mastodon, a social network based on open web protocols and free, open-source software. It is decentralized like e-mail.