1. 19
  1.  

  2. 3

    I am toying with an idea of a typed OS, where every interaction of kernel and processes is strongly typed using MIME types and e.g. capnproto (every message and file have a type like image/jpeg, capnp/@0xdbb9ad1f14bf0b36; IPC is made RPC-like. This OS should have a registry of messages types and RPC services. This registry can be either system-level or a world-wide one using Merkle trees to have common language between different machines.

    I feel like Unix simplicity of the bag of bytes might still win over this design, but not sure how exactly. Maybe the times have changed indeed and nowadays we have the proper tools to type data.

    1. 2

      I’m wondering how you deal with formats like JPEG in a structured object system. Do you treat them like opaque bags of bytes, or parse them to allow them to participate in the system?

      It’s similar for i.e. BeOS with filesystem-side tagging vs. inline ID3 tags.

      1. 1

        Didn’t OpenBSD get some kind of typesafe pipe functionality recently? My search-fu is failing to find it.

        1. 1

          Yeah, I feel that it might break down in some ways. For example, a lot of the time images I download are labeled incorrectly, you would need to have a system for dealing with obscure or user-created filetypes, etc.

          (shameless self-promotion) In a similar vein, a while back I wrote a program to annotate files via the filesystem attributes, as far as I know it’s pretty solid but there are some places where it could and should be sped up. There’s also a C library that’s a toolbox of functions that the client rests upon, other clients (maybe nautilus integration?) were intended to be made, and it has an auto-tagging facility based on mime-types which should (maybe doesn’t?) deal with all of the use-cases.

        2. 2

          This article doesn’t discuss, perhaps assuming as background knowledge, the reason that defined file formats are useful: They allow multiple different independent programs to operate on the same data.

          For this reason, storing and associating the creator program (as MacOS does) has always seemed regressive to me. A file of well-defined type should have meaning independently of any particular program.

          1. 9

            That’s exactly what separating the creator from the type was meant to allow…

            The creator specified the icon and the default application that would open if you didn’t specify another one. But applications chose to accept files based on the type, not the creator, so you didn’t have to have a one to one mapping of types to applications.

            1. 1

              There was a talk about this at a recent WWDC, talking about how this works in current macOS:

              https://developer.apple.com/videos/play/tech-talks/10696

            2. 2

              I find the “pixel art vs photo editing” argument kind of compelling that even an extension/magic-based system has limitations.

            3. 1

              In practice, the file extension is always there, and it has to be correct. So why bother with a MIME type or anything else?

              1. 3

                One of the things I lived when I left windows was leaving file extensions behind. Sure, many people are used to them and still use them, but I have a lot of files with no extension

                1. 3

                  Because file extensions are an awful compromise.

                  1. 2

                    It’s OK, someday we’ll make the eternal return to the Application ƒ…

                    1. 2

                      But it’s the compromise we’re stuck with. We might as well make the best of it by having a single point of truth.

                      1. 1

                        Yeah, I know. But, to quote from my profile:

                        tilter at path-dependent windmills

                        I hate hate hate hate that Apple chose to go the direction they did; the only thing I think I’d hate more is if they hadn’t allowed the NeXT people to swallow them whole and died. So, yeah.

                        1. 1

                          It’d mean you could be a revanchist for the Mac-as-intended though. (I just don’t think the classic Mac OS would inspire the same fervour as like, Amiga people do, for “bring it back” though. Those guys are nuts.) When people like Gruber talk about the pre-X world, few recognize it.

                          1. 1

                            It’d mean you could be a revanchist for the Mac-as-intended though.

                            That would be a crusade for a younger me.