guitarvydas / 0D

component-based software using drawings as source code
3 stars 0 forks source link

Is helloworld0d.drawio valid 0D? #4

Closed RAbraham closed 3 months ago

RAbraham commented 3 months ago

helloworld0d has two diagrams separated by sectional headings (e.g. 'Sequential Routing' and 'Parallel Routing')

image

Is this a valid diagram. i.e. when this diagram is compiled, how are these two diagrams in the same tab compiled?

guitarvydas commented 3 months ago

This is a valid diagram. The visual stuff on the diagram that has no syntactic meaning is simply ignored and treated as a comment. Note that the gate (rhombus) called "" (empty string) appears in two places. Instead of drawing connecting arrows from a single gate."" to both networks, we simply drew 2 copies of the gate."" rhombus. This makes the diagram look less-busy. The compiler doesn't care, it just look for single connections. In this diagram, it finds 3 single connections from gate."" to child components, and, it generates 3 connection structs, one for each 1:1 connection. The low-level detail that is important here is that these connections are from gate-to-port, which is a "down" connection. (port-to-port is "across", port-to-gate is "up" and - edge-case - gate-to-gate is "through"). This diagram contains 3 "down" connections, it contains 1 "across" connection and 3 "up" connections. 2 of the "up" connections go to gate."par" and 1 of the "up" connections goes to gate."seq". I won't bother to list every connection on this diagram... If you look at the associated .json file, you should see all of the connections listed in JSON format. The JSON files contain exactly the same info as the diagrams, but, I find the diagrams easier to read.

RAbraham commented 3 months ago

got it. thanks