Closed emil14 closed 9 months ago
Since records are go maps with string keys and arrays are slices, I see no problem in having str
and int
constants inserted in the connections as a proxies that unbox values from structured messages. There are normal and de-sugared form of a program (HL repr). Normal form might contain things like "rec field" or "arr idx" fields in connection structures but desugared must not have it (actually it can, but we will ignore them). OTOH desugared version will contain extra connections to those special (un)box components
How to implement expressions like x[0].a
? I mean, do we have 2 components one for records and one for arrays or one universal typedUnboxer/Selector
? If we have special unboxer for records can it eat stuff like a.b.c.d.e
or just a
? If we have universal component then it must parse strings at runtime which is very bad. If we have separated record and arrays components then we gonna have chains of implicit unboxers that we gonna see if we log stuff. That also means more work at connector (network manager) level, more pointers passing around, more loop iterations.
We use triggers to implement static inports. Why don't we use components to implement record fields and array elements reading? It would simplify program structure.
The problem is in langs like go when we say
v.x
we do expression wherev
andx
are operands andx
is not a string literal. If we introduce components then we got to create strings for that. It's either user creatingstr consts
or compiler somehow generating that stuff.