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

Outline of structs as a general 'definition' system #7069

Merged
merged 6 commits into from
May 30, 2024

Conversation

flyingsilverfin
Copy link
Member

@flyingsilverfin flyingsilverfin commented May 17, 2024

Usage and product changes

We introduce the architecture around structs definitions, and definitions in general.

The idea of a definition is that it is a general schema construct outside the regular thing and type system - this will initially be used for structs and functions.

Definitions are interesting because their interesting payload is in the value, not the key. However, the key contains the ID of the definition. As a result, you can consider the new DefinitionKey to be analogous to TypeVertex, but the interesting data structure is the StructDefinition, which serialises a struct's content.

In doing this, we also realise that ValueType must encompass the built-in value type category, plus the ID of the struct definition, and create a new ValueTypeCategory which can map to a Prefix and doesn't contain the ID of struct definitions. Lastly, we create a the serialised form of ValueTypeBytes, which is used as the property of an attribute type's value type, including the definition ID if it exists.

What isn't implemented yet:

  1. The indexing + retrieval by name of value types through the TypeManager
  2. Serialisation of StructDefinition
  3. The data insertion and deletion pattern of struct instantiations

@vaticle-bot
Copy link
Member

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Trivial Change

  • This change is trivial and does not require a code or architecture review.

Code

  • Packages, classes, and methods have a single domain of responsibility.
  • Packages, classes, and methods are grouped into cohesive and consistent domain model.
  • The code is canonical and the minimum required to achieve the goal.
  • Modules, libraries, and APIs are easy to use, robust (foolproof and not errorprone), and tested.
  • Logic and naming has clear narrative that communicates the accurate intent and responsibility of each module (e.g. method, class, etc.).
  • The code is algorithmically efficient and scalable for the whole application.

Architecture

  • Any required refactoring is completed, and the architecture does not introduce technical debt incidentally.
  • Any required build and release automations are updated and/or implemented.
  • Any new components follows a consistent style with respect to the pre-existing codebase.
  • The architecture intuitively reflects the application domain, and is easy to understand.
  • The architecture has a well-defined hierarchy of encapsulated components.
  • The architecture is extensible and scalable.

@flyingsilverfin flyingsilverfin changed the title WIP outline of structs as a general 'definition' system Outline of structs as a general 'definition' system May 30, 2024
@flyingsilverfin flyingsilverfin marked this pull request as ready for review May 30, 2024 10:11
@flyingsilverfin flyingsilverfin merged commit 67149e1 into vaticle:3.0 May 30, 2024
1 check failed
@flyingsilverfin flyingsilverfin deleted the structs branch May 30, 2024 10:13
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

Successfully merging this pull request may close these issues.

None yet

4 participants