guitarvydas / 0D

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

What syntax is from Input down? #6

Closed RAbraham closed 4 months ago

RAbraham commented 4 months ago

Can you explain how the following syntax works? I see Input going to what I understand to be hardcoded values like RWR , '0d/odin/std/rwr.ohm' etc?

image
guitarvydas commented 4 months ago

This is an idiom of the 0D paradigm. The payload of "input" goes further to the right the "input" of the Ohm component. The input message also triggers the string constants to send out their hard-coded values. The string-constant boxes don't care what the payload is, they only care that an event has happened. In this case "input" triggers the boxes like '...rwr.sem.js' but they don't look at the payload of input, they simply send() out their hard-coded strings when something - anything - hits their inputs. The rectangle for string-constants, like '....rwr.sem.js' is drawn long and thin, but that doesn't matter - from the compiler's perspective, it's a Rect, just like any other Rect on the diagram. The way I've drawn it, a string-constant Rect has exactly one input called '⍺' and exactly one output called '⍺'. The way I've drawn it is fairly low-level - it is syntactically inconvenient for humans to draw in the triggering connections (the '⍺' inputs). Ideally this kind of low-level detail will be elided, but, for now, I want to know all of the niggly details and, I want to make string-constants work the same as any other component, so I draw the input triggers in manually (you will notice, that I used 1px line-width for such "unimportant" arrows and 2px line-width for architecturally more-important arrows, though - again, the line-width is ignored by the compiler - I could have made the lines even thicker or used different colours - the compiler ignores all of that and just pays attention to what is connected to what, regardless of visual appearance).

RAbraham commented 4 months ago

understood. thanks

guitarvydas commented 4 months ago

I intended to write a 1-line further comment about 0D idioms, and ended up writing a blog post https://guitarvydas.github.io/2024/03/30/Breaking-Free-of-Sequentialism-and-Synchrony.html