Giter VIP home page Giter VIP logo

Comments (4)

emil14 avatar emil14 commented on May 26, 2024 1

Connection payload/meta

Update Connection to { from addr, to map[addr]payload } where payload describes how connector should interpret incoming message before sending it to receiver.

Payload could be something like:

{
  type: PayloadType # normal | struct field reading
  structField: []string
}

Pros:

  • Compile time safety - structure of message is known before program is running so solution this problem must be part of the program itself, like expression in the tree-based languages
  • Allows to execute nested access requests like x.y.z in a row without using lots of components and without making the program flow complicated with error checks

Cons

  • Leads to modifications of port-address - Must be VERY good thought

Maybe solution for #37


UPD

    net:
      in:
        <name>:
          - nodeType: worker
            name: <worker_name>
            meta:
                connectionType: normal | structReading
                structPath: [foo, bar] # value.foo.bar

from neva.

emil14 avatar emil14 commented on May 26, 2024 1

Component based approach

Use some generic struct field reader component with in: struct, field and out: field

Problems

  • Type-checking: since there is no IIP-only ports (ports that are feeded by only const nodes) there is no way to compile-time check if struct has some field or not
    • some err port must be introduces which is bad - in Go we have compile time checks for this set of errors

from neva.

emil14 avatar emil14 commented on May 26, 2024

Effect fieldReaders

        nodes:
            fieldReaders:
                userAge:
                    field: age # must throw compile err if needed

from neva.

emil14 avatar emil14 commented on May 26, 2024

#31 (comment) Choosed

from neva.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.