Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime port representation #34

Closed
emil14 opened this issue Mar 3, 2022 · 2 comments
Closed

Runtime port representation #34

emil14 opened this issue Mar 3, 2022 · 2 comments

Comments

@emil14
Copy link
Collaborator

emil14 commented Mar 3, 2022

It's not clear what data must be present at runtime level due to issues with maps and structs. Current implementation assumes names and indexes but it may be wrong

TODO figure out real cases that must be solved

@emil14
Copy link
Collaborator Author

emil14 commented Mar 13, 2022

TODO think better

// compiler 
type Ports map[string]Port

type Port struct {
  Type PortType // single | array
  Len uint8 // always 0 for single
}

// runtime

type Ports map[string]map[PortAddr]chan Msg // node_full_path -> ...

type Connections []Connection
type Connection struct {
  From PortRef
  To []PortRef
}

type PortAddr struct {
  IsArrEl bool
  Idx uint8
  Name string
}

type PortRef struct {
  IsArrEl bool
  Idx uint8
  Name string
}

// core
type Ports map[string]Port

type Port struct {
  Type PortType // single | array
  Single chan Msg
  Arr []chan Msg
}

@emil14
Copy link
Collaborator Author

emil14 commented Nov 8, 2022

why this exists?

@emil14 emil14 closed this as completed Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant