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

[For Further Discussions] Better format for structs #733

Open
kenje4090 opened this issue Jan 18, 2022 · 0 comments
Open

[For Further Discussions] Better format for structs #733

kenje4090 opened this issue Jan 18, 2022 · 0 comments

Comments

@kenje4090
Copy link
Collaborator

kenje4090 commented Jan 18, 2022

CX Struct definition

One array vs N-arrays

CXStruct

  • num fields
  • field string
  • field offset
  • field size
  • field type
    • Type ID (CX atomic, cx atomic pointer, cx struct pointer, cx struct)
    • Field
      • If CX atomic then type id
      • if struct pointer then pointer id
      • if cxatomic pointer then the type of the cx atomic

CXStruct Definition

  1. A struct
  2. the variable layout of a function
  3. the inputs to a function
  4. the outputs of a function
  5. It has the same layout format as a “struct” definition

Is there a “dynamic variable” struct that can define other types at runtime?

TypeID

  • CXAtomic
  • CXAtomicPointer
  • CXStruct
  • CXStructPointer
  • CXArray
  • CXArrayPointer
  • etc
    TypeField
  • If CXAtomic, then CXAtomic type
  • if StructPointer, then the pointer id
  • If CXAtomicPointer, then the type of CXAtomic
  • etc
    Ptr to data/object
    in theory any operation on fixxed data can now occur on an atomic data


Arrays of TypeID and TypeFIeld is enough to define a CXFunction, input and output
and the packing of variables in function bodies

CXStruct Definition

  1. Type Signatures
  • StructFields/Elements/“slots”
  • variable type
  • the misc mets identifier
  1. Data layout/offsets
  • Byte offsets for each data field in a struct
  • Byte offsets for each data field/variable in a cx function
  • Inputs to a function/signature
  • Outputs of a function/signature
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