Are there any examples that have a platform that has a hosted effect that takes a record as a parameter? Such as
Data : { x : I32 }
doSomethingWithData : Data -> Task {} {}
Here's an example https://github.com/roc-lang/basic-cli/blob/9170961a537030b1aa5880774ff14d0c1f30b40c/crates/roc_host/src/lib.rs#L902
Thanks!
do records have to be boxed? Looking at sendRequest : Box Request -> Task InternalResponse []
No
If you Box
it, roc will store the data on the heap and pass by pointer
I think it uses roc_alloc
provided by the platform
If I'm not boxing, is it possible I'm going to run into ABI issues like with Result
? I'm trying to pass a record by value in the zig platform and not having good results yet
is it possible I'm going to run into ABI issues like with
Result
?
Yes, but a lot less likely
I would say it's definitely possible to bump into ABI issues. This area isn't very well explored. Usually it's like @Brendan Hansknecht and myself figuring this out as we go. There are definitely known and unkown bugs we run into regularly.
Last updated: Jul 06 2025 at 12:14 UTC