• Dmian@lemmy.world
    link
    fedilink
    arrow-up
    6
    arrow-down
    3
    ·
    edit-2
    9 months ago

    Are you talking about sending the output of one process to the input of another?

    I think the shaders I’ve mentioned are a great example of that: you do something in a block, then send the result to the input of another block.

    Sorry if it’s not what you mean, but my point is that, with some effort, you can create a visual representation of even the most abstract concepts. Physicists do this constantly. If we can make a visual representations of 4D, for example, what prevents us from doing the same for programming logic? Or for commands?

    • Avid Amoeba@lemmy.ca
      link
      fedilink
      arrow-up
      6
      ·
      9 months ago

      Yeah, and doing this would take significantly longer to use every time than typing up a chain of commands in a terminal.

      • Buddahriffic@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        9 months ago

        Things like that have been around for a long time. It was like two decades ago that I saw this shader scheme in softimage|xsi.

        For implementing something like that, each node in that graph would have an array of inputs and outputs. Each of those would have a type like vector, scalar, colour, string. Then you only allow connections if the inputs and outputs match types (though you can also have conversion nodes or selectors that say pick the red channel of a colour to turn it into a scalar). Each input can be set to a constant value instead of connecting something else to it. Outputs don’t need to be connected, which is mostly useful if a node has multiple outputs. Then each node has an evaluation function that takes all input parameters and maybe internal configuration parameters (though you might as well make everything an input param since there’s no real functional difference) and uses them to calculate the outputs, which it then sends on to anything connected to those.

        I’m not much of a UI guy but displaying it for the GUI would just involve drawing boxes or some shape for the node, then spaces for each of the inputs on the left side and outputs on the right side maybe colour code them by type, and lines running along the connections. Then just add the name and/or other visual information you want to display and positional information to let users move it around their work area.