yutannihilation / savvy

A simple R extension interface using Rust
https://yutannihilation.github.io/savvy/guide/
MIT License
63 stars 3 forks source link

Convert async to ALTREP #185

Open yutannihilation opened 5 months ago

yutannihilation commented 5 months ago

Will it be useful?

yutannihilation commented 4 months ago

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

Random thoughts.

yutannihilation commented 4 months ago
  • 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