Comment by ori_b

21 days ago

Typically, if you were writing your hypothetical sql client in rc shell, you'd implement an interface that looks something like:

    <>/mnt/sql/clone{
        echo 'SELECT * from ...' >[1=0]
        cat /mnt/sql/^`{read}^/data # or awk, or whatever
    }

This is also roughly how webfs works. Making network connections from the shell follows the same pattern. So, for that matter, does making network connections from C, just the file descriptor management is in C.

This is... I don't know. I don't get why I would care to sling SQL over a file system versus a network socket.

I mean, Postgres could offer an SSH interface as a dumb pipe to psql to just have you push text SQL queries in your application. But it doesn't, it offers a binary protocol over a network socket. All the database engines have had the same decision point and have basically gone down the same path of implementing a wire protocol over a persistent socket connection.

So yeah, I don't get what doing things this way would give me as either a service provider or a service consumer. It looks like video game achievements for OS development nerds, "unlocked 'everything is a file'." But it doesn't look like it actually enables anything meaningful.

  • How would you connect to Postgres in 4 lines of shell normally? How would you do it for a rest api? How about any other systems?

    For Plan 9, it's all the same, all using the same interfaces, with little library glue.

    Opening a window, and running a command in it? Similar interfaces. Adding LSP to your editor? Got it, you mount it and write to the files.

    Universal shared conventions are powerful.

    • But if it requires understanding of a data protocol, it doesn't really matter if it's over the file system or a socket or flock of coked-up carrier pigeons. You still need to write custom user space code somewhere. Exposing it over the file system doesn't magically make composable applications, it just shuffles the code around a bit.

      In other words, the transport protocol is just not the hard part of anything.

      1 reply →

  • The benefit is that you can allocate arbitrary computers to compute arbitrary things. As it is now, you have to use kubernetes and it's a comedy. Though perhaps the same in effect, there are dozens of layers of abstraction that will forever sting you.

    You're thinking from the perspective of the terminal user—ie, a drooling, barely-conscious human trying to grasp syntax and legal oddities of long-dead humans. Instead you need to think from the perspective of a star trek captain. Presumably they aren't manually slinging sql queries. Such tasks are best automated. We are all the drooling terminal user in the end, but plan9 enabled you to at least pretend to be competent.