Re: Why I don't like files
Posted: Fri Mar 09, 2012 5:42 pm
Hi,
Essentially, what (I think) you're suggesting is to replace files with objects; so that applications don't need to understand the file's format and only need to understand the class' methods.
The problem with this approach is that you can't call a method that doesn't exist. For example, if your kernel's "image" class only has a "resize()" method and your application wants to rotate the image, then you're screwed. The kernel would have to have a class for every type of file, and each of these classes would need a method for every possible operation that anyone could ever want.
This would make applications much simpler. However, the kernel would need to be massive bloated mess full of functionality that someone might want but most people never actually use. For an example, for image files alone, what methods would your kernel need? The basic things (display, crop, resize, etc) probably aren't too bad, but all the various transformations (blur, sharpen, emboss, etc) are stretching it, and then there's there's things like OCR.
Then, on top of this you add single-level store; so now you've a class for every type of file, a method for every possible operation, plus every scrap of code and data mapped into the virtual address space somewhere; all of which is "just in case someone might want it one day" (and 95% of it would be unused 95% of the time). My prediction is that you're going to have to implement it for true 64-bit CPUs, because the 48-bit virtual addresses that 80x86 supports in long mode isn't going to be enough to cope with the overwhelming quantities of bloat.
Cheers,
Brendan
Essentially, what (I think) you're suggesting is to replace files with objects; so that applications don't need to understand the file's format and only need to understand the class' methods.
The problem with this approach is that you can't call a method that doesn't exist. For example, if your kernel's "image" class only has a "resize()" method and your application wants to rotate the image, then you're screwed. The kernel would have to have a class for every type of file, and each of these classes would need a method for every possible operation that anyone could ever want.
This would make applications much simpler. However, the kernel would need to be massive bloated mess full of functionality that someone might want but most people never actually use. For an example, for image files alone, what methods would your kernel need? The basic things (display, crop, resize, etc) probably aren't too bad, but all the various transformations (blur, sharpen, emboss, etc) are stretching it, and then there's there's things like OCR.
Then, on top of this you add single-level store; so now you've a class for every type of file, a method for every possible operation, plus every scrap of code and data mapped into the virtual address space somewhere; all of which is "just in case someone might want it one day" (and 95% of it would be unused 95% of the time). My prediction is that you're going to have to implement it for true 64-bit CPUs, because the 48-bit virtual addresses that 80x86 supports in long mode isn't going to be enough to cope with the overwhelming quantities of bloat.
Cheers,
Brendan