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

Schemas and dynamic values #62

Open
tertsdiepraam opened this issue Sep 9, 2024 · 0 comments
Open

Schemas and dynamic values #62

tertsdiepraam opened this issue Sep 9, 2024 · 0 comments

Comments

@tertsdiepraam
Copy link
Contributor

tertsdiepraam commented Sep 9, 2024

We can currently compile a Roto script and then use get_function to get a function with known types from it. This is nice and works well within Rust, but it might not cover the use cases for Rotonda, because there we might need to pass types into a Roto script that are unknown at Rust compile time. This can for example happen in a case where we take the output of a Roto script and pipe it into another Roto script or store it in a database. In that first case, we need to know that the output type of the first script matches the input type of the second script. That's where schemas come in.

In list form, we need:

  • A type that represents some Roto type with a value that describes it's type. In other words: a dynamic Roto value.
    • In some way, this is equivalent to the TypeValue enum from the previous Roto version, but I'm envisioning this as a slice of data with type information instead. This ensures that we can also erase the type information and just work with slices once we have checked that the types are correct. It's also more flexible because it will support runtime types and other complex types.
  • Some way to retrieve schemas of types and functions from Roto, so we can inspect the types used in the script.

The way that we can implement this is by generating a *_dynamic version of each function that we expose. This version will take a pointer for each of its arguments and then call the non-dynamic version automatically.

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