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

#203 - Nuanced types #206

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

#203 - Nuanced types #206

wants to merge 4 commits into from

Conversation

oscartbeaumont
Copy link
Owner

@oscartbeaumont oscartbeaumont commented Dec 24, 2023

The high-level thinking is to separate the idea of a Rust declaration and a Typescript type. Would this mean we can remove Any, Unknown and PrimitiveType/LiteralType::None.

Questions:

  • How should List and Map constructors deal with inline vs reference
  • Right now you can have a DataType::Nullable(DataType::Nullable(...)) which is not great. Should we have it be more split up.
  • How does DataTypeFrom fit into this?
  • Should Type::inline go and instead have Reference { inline: true } and post-process it?
  • Should we merge Reference and DatTypeReference?? I feel like it makes it more typesafe so probs.
  • What if inline and definition become one method and the generics arg is an enum instead.
  • Removing NamedType???

TODO:

  • Can ImplLocation be constructed using use_caller? Should it be removed?
  • Public List constructor
  • Public Map constructor
  • DataType::is
  • Give each type a SpectaID including primitives.
  • std::convert::Infallible should be rejected by the Serde validator.
  • Rename List and Map to ListType and MapType
  • Support ! but with Serde exporter warning
  • Option for static arrays. A normal data structure should require zero memory allocations.

Tied to #203 and #140.

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

1 participant