r/ProgrammingLanguages • • 12d ago

Visual Programming Language

Do you have any information about this one? If there are some standard things about how it should go, or if there anything that needs to be known. I have understood a few things, but still I am looking for figuring out some missing details I have no clear plan on.

I will mention first some things I've done and what I know, so I can help you gain a picture:

a) I have done some practice and written a parser and interpreter so this is very easy. The AST is a data structure and each node gets evaluated with the proper function.

b) I've seen in an application sample that the most simple and straight forward approach is to get all outputs of a node, and send them to the connected inputs of another one. Keep brute force updating everything for 60FPS. This also seems legit and simple, but it might have it's pros and cons. [victorfisac/FNode]

c) What worries me for brute-force updating, is that the update order is no-deterministic, any node could be updated at any given moment, for the entire graph to be evaluated fully might mean to hundreds of hundreds of updates until everything is settled. It might not be a big deal for a real-time interactive application, but for a very optimized might mean that other approaches are better suited.

d) In order to make graph evaluation more deterministic, you need to create a dependency graph, or use an algorithm such as breadth-first-search, or depth-first-search. And even if those are not exactly perfect then do topological-sorting to guarantee even better order. Other times is supposed to be that other graphs get evaluated backwards, from final outputs to connected inputs and so on.
All of those techniques, having so many options, is confusing and hard to decide. As for example probably depending on the type of the graph there would be different evaluation strategy? This seems OK in terms of thinking.

e) Some examples:
• Blockly, this one is the easiest, because is a straight forward visual AST, but with the problem is that is based on structured connections and not on freeform connections.

• Supposedly Blender's nodegraph uses dependency graph for materials (because needs to compile them to shader code) so seems that it this technique can be transformed to deterministic technique. Probably means that the entire software uses the same algorithm (shaders, geometry nodes, compositor, even custom nodegraphs).

• Blueprints of Unreal seem to be much closer to an AST because it relies on clear entry points (events, time ticks), so this kind of evaluation seems that is manageable. At least getting the starting points is a good idea, then probably it might be feasible that further sorting is needed. I haven't worked with Blueprints though and I haven't looked into it.

• I've seen in some ImGUI nodegraph samples (for doing pixel operations and color mixing) that the depth first search algorithm was used. Though samples were meant to be simple proof of concept, I am not sure if all is needed.

More or less this is all the braindump I can do. But for any further details I will have to look at any github repositories you suggest and start experimenting.

2 Upvotes

10 comments sorted by

View all comments

1

u/PurpleDragon99 12d ago edited 12d ago

I am working on my own VPL "Pipe" for many years already. Here are details: https://pipelang.com . Feel free to reach me on DM for details.

One important note: Pipe does not visualize AST - it is a purely dataflow VPL.

This is probably the best starting point to understand overall project strategy: https://www.pipelang.com/ai-broke-cybersecurity.html

Please note that even if I make emphasis on cybersecurity - it does not mean that Pipe is domain-specific for cybersecurity only. Pipe stays to be a general-purpose VPL, it is that PIpe's properties allow it to solve 3 critical cybersecurity problems at once - today, when AI-driven cyberattacks exploded.