A Constructive Look At TempleOS

got sick of trying to articulate my thoughts, second half of comment is incomplete

Files with records. They're not good in general-purpose systems.

Er, yes they are -- otherwise you wouldn't have records in [e.g.] C that you sling into files.

Yeah, but that's a record structure that you've built yourself on top of the flat structure. What I'm arguing against here is files where the structure is given at the system level. You seem aware of this, but I'm saying anyway.

Having structure in files seems like something that would make writing programs easier if you knew in advance what every program was going to want to do with the files. In a single-purpose system it should be possible to do this. Indeed, even in Unix, there's a strong separation between a file's name, contents, and the various timestamps, and the reason for that is that they know in advance that people want them separable.

But you don't really know in advance that files are going to contain a tree structure, a 2D array of colour values, a column-oriented programming language, or anything else, though. So the best thing, for the case of the general-purpose OS, is to have unstructured files that different groups of programs can define their own conventions on top of.

And there's no reason that [pipes] can't be strongly typed -- Example: Ada's stream facilities.

Yes, or the PowerShell stuff. It's natural to want this stuff, but is it the operating system's business? Also, since typed-in input won't really have structure other than tabs and linefeeds, you're creating a difference between typed-in input and piped-in input, which is a loss of predictability, transparency, and other things. That's the stuff that I'm conjecturing is the main difference between pipes and IPC, and why the former something that users can use, not just programmers.

The particular high-level object I'd like to see is a date object, where you can use <, <=, ==, etc regardless of whether it's a Unix time, a date string, an American-style date, whatever. But how can we use this? It's easy to say that a log file should be record-structured with fields within the records, and that the date field should have type DateObject. And it's easy to say that the stdout of cat that_file should have that same structure.

But what about a text document or source file containing that date? Do we switch over to

/r/programming Thread Parent Link - codersnotes.com