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

Convert async to ALTREP #185

Open
yutannihilation opened this issue Apr 15, 2024 · 2 comments
Open

Convert async to ALTREP #185

yutannihilation opened this issue Apr 15, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@yutannihilation
Copy link
Owner

Will it be useful?

@yutannihilation yutannihilation added the enhancement New feature or request label Apr 20, 2024
@yutannihilation
Copy link
Owner Author

PoC: https://github.com/yutannihilation/savvy-async-poc

Random thoughts.

  • Apparently, R API cannot be called in parallel.
    • Probably, the SEXP should be allocated beforehand and write the the underlying array?
    • But, it might not be always the case that the length is known.
    • Can I prohibit the use of APIs?

@yutannihilation
Copy link
Owner Author

yutannihilation commented May 8, 2024

  • Probably, the SEXP should be allocated beforehand and write the the underlying array?

After some thinking, with the current implementation, there are almost no problem because such methods as etl() and copy_data() returns the primitive values and it's converted after the future returns the values.

One problem is that AltList currently requires the return type of Sexp. This should probably impl TryInto<Sexp> or something.

https://yutannihilation.github.io/savvy/reference/savvy/altrep/trait.AltList.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant