nevalang / neva

🌊 Dataflow programming language with static types and implicit parallelism. Compiles to native code and Go
https://nevalang.org
MIT License
85 stars 7 forks source link

One-shot nodes and IIPs (static messages) #292

Closed emil14 closed 1 year ago

emil14 commented 1 year ago

In "Dataflow and reactive programming" book IIPS (initial values/tokens) described as things that are sent only once. This is not how this work in Nevalang.

  1. Find out how this works in FBP
  2. Find out what are effects of that
emil14 commented 1 year ago

Chat GPT response

_In FBP, an Initial Information Packet (IIP) is sent only once to a process at the beginning of the execution of a network. The IIP is used to initialize a process's input port with a specific value. After the initial packet is sent, the process is responsible for generating its own input packets.

In your example of the "+1" component, the IIP carrying the value of "v" will be sent only once to the "sum" process's input port "a". However, the "1" value can be sent repeatedly to the "sum" process's input port "b" using a generator process. This generator process could take the form of a separate process, as you suggested, or it could be part of the "+1" component.

The decision to use a "once" or "infinite" IIP depends on the specific use case. In general, "once" IIPs are useful for initializing a process's state, configuration, or other static data. "Infinite" IIPs are useful when the input data is dynamic and changing over time. For example, if a process is reading data from a sensor, an "infinite" IIP can be used to continuously update the process with the latest sensor readings.

In summary, an IIP is sent only once to a process at the beginning of the execution of a network. To send dynamic input data to a process, you can use a generator process or design your component to generate its own input packets. The choice between "once" and "infinite" IIPs depends on the specific use case._

emil14 commented 1 year ago

Fig5 1

emil14 commented 1 year ago

^ How this supposed to work if IIP sent once? Selector must be implemented in a way it knows that something (OPTIONS in this case) must be requested only once. Isn't this violation of the principle "component must not know where it gets its data" - from IIPs or normal IPs? FBP book claims that this principle is not violated.

emil14 commented 1 year ago

Discord Topic

https://discord.com/channels/760229165856587817/760229165856587820/1102500624773423186

We struggling to understand each other :(

emil14 commented 1 year ago

@TimurGrenda approved that IIPs (static messages) not being sent infinite amount of times (with blocking ofc) lead to violation of decoupling. I.e. I cannot simply reuse same component with both IPs and IIPs WO modification of it.