berkus wrote:Didn't read all the comments, only the OPs post so pardon if I repeat someone else's words.
1) You seem to favor passive objects, which is nice and dandy, but requires very fine grained locking to be able to scale in the SMP case.
2) You seem to favor object inheritance instead of interfaces which is a not scalable feature as well.
3) When you have interfaces implemented by components you don't really bother about file formats and storage anymore. Once your component is able to support some basic interfaces (like Image related ones), applications in general couldn't care less what format it uses in the back end, and whether it's backed by files, storage nodes, hyperwave clusters or proton clouds.
1) What do you mean by SMP? Or passive objects for that matter.
2) I wasn't aware inheritance vs. interfaces was a choice. Or that it wasn't scalable. Care to elaborate?
3) Pretty much, yes.
berkus wrote:This is called Single Address Space. And it has its own limitations, of course. But I also see a lot of benefits in using it.
Ok, good term to know I guess. I think the biggest drawback with using single address space is running out of virtual addresses. On 32-bit systems that's more or less a deal breaker, but on 64-bit systems, even though you can't really use the whole 64-bit virtual address space, it's not really an issue. And on my OS, there are several elements of the design that do demand a single address space architecture. Having a simple mechanism for sharing nodes across memory spaces, for example, is one my design goals. That's another aspect of my design that proved to be much more difficult to get down than I ever could have anticipated, but I have a pretty good idea of how I'm going to approach it now.
Hey look, I found a paper from 20 years ago suggesting that it might not be a such a bad idea to
switch to single address space for 64-bit OS's. I might want to read that some time.
Gigasoft wrote:This is actually somewhat similar to what I have been planning.
The problem with traditional operating systems is that every application is responsible for providing menus for loading and saving, asking the user which file to open, figuring out the file type, dealing with filesystem paths, and handling the contents of files. This has the result that different vendors' applications vary in the conditions under which they will function. For example, one video editing application might use DirectShow filters to load videos, while another might use Video for Windows codecs, and a third can only load a fixed set of formats that the developer chose to implement. Some applications will refuse to load and save files to a deeply nested location, and others will not be able to load a file whose name contains foreign letters.
This is what I'm saying. Seriously, this is nuts. Why should things be this inconstant and convoluted? We pretty obviously need something better than the status quo here.
Gigasoft wrote:However, no matter what kind of solution one ends up with, although it may be complicated under the hood, it's crucial that one makes it as easy as possible for the application developer to implement things in the correct manner according to one's design. If it's easier to program things in the same way as they've done for the past 10 years, chances are they'll do just that.
My thoughts exactly. In order to get people to adapt something, it has to make their lives easier. And not just a little easier either. To get people to give up decades of established software, you have to do a lot better. I strongly think I'm onto something in that respect. I think I'm getting to the point where I could say it would take 1/10 as much code on average to program something in my OS as it would in C. And the resulting code would be simpler, more reusable, and more maintainable by a significant margin.
Gigasoft wrote:I doubt that this is what the OP intended. An "image" class would typically contain functions to access the image data, whereas the application would be responsible for actually manipulating it. If the system can load any type of image file format for which a handler is installed, the mission is accomplished. For shell script usage, having a few toy commands such as "resize" might not be such a bad idea, though.
Basically, yea. Having a resize command baked in is a convenience thing, and I wouldn't go overboard with stuff like that. What I would actually do in practice for this kind of thing is to have an Image::Filter module that contained classes with typical image manipulation capabilities like resize or blur. Only the really commonly used stuff would go into methods of the image class, for the sake of convenience.
I should also mention that my OS does not really favor implementing functionality in applications. What I mean by that is, when you want to write code that actually does stuff, you have to fit it into the OS's class hierarchy. In my OS an application is nothing but another interface to functional code. In fact, all "applications" in my system must by subclasses of a class in the Interface module. Interfaces are intended to get stuff done by using code that exists elsewhere in the system. In theory, if you can do it in an application, you should be able to do it in the shell, or any other component in the system. You never write code just for one application, you write it for the system itself.