|P is for Practical|
Re: Re: Re: Use of .pl versus .plx file extensionsby QwertyD (Pilgrim)
|on Mar 22, 2004 at 01:58 UTC||Need Help??|
let a file be a file , not several streams of info that stay relevant to each other until after the first :w!
I have to disagree with you here. Certain useful metadata must be kept in sync with a file's contents. The length of the file, and the file's last modified date, for example. While you could argue that these are unneccessary, it's extremely difficult to live without them. Sure, you could have null-terminated files, but then you couldn't store binary data. (You could get around this by backslash-escaping non-terminating nulls, and then backslash-escaping every backslash, but I shudder to think of a filesystem that required any of that.). Sure, you don't *need* to know when a file was last modified, but then it's a lot harder to do incremental backups.
With those two examples, the operating system deals with keeping the metadata in sync with the file. But what about a program? In UNIX, the hasbang line we all know and love acts as metadata, because it says what program should be used to run the file (I'm a UNIX newbie, so correct me if I'm wrong about this). Port a shell script to Perl, but leave a #!/bin/sh at the top, and it's not going to work correctly if you try to execute the file.
So now that we've found an instance in which it is more convenient to store metadata about what program can understand a file, why not extend that to storing metadata about what kind of file it is? Suddenly, you can have the OS figure out what to do with the file when you open it (even more so if you store creator AND filetype metadata). Applications can figure out on their own which files they can open and process. Searching can be done for certain kinds of files.
The benefits of all this kind of metadata far outweigh the costs of maintaining it. Besides, is it even that common to have one file whose type changes often?
For more info, read John Siracusa's Metadata, The Mac, and You at ArsTechnica.
Once it's Turing complete, everything else is just syntactic sugar.