3 ms·
Cases with primitive arguments are easy to understand, but I think it would be beneficial for the Rust book to have way more detailed info about working with bu
by hsivonen 11y ago
Cases with primitive arguments are easy to understand, but I think it would be beneficial for the Rust book to have way more detailed info about working with buffers and heap-allocated structs that the other language holds onto past the foreign call returning. Looking at examples on github (I don't mean the ones from this blog post), one can believe the examples work, but it also looks like there's undocumented knowledge about deep implentation detail involved when e.g. allocating something in one language and then letting the other language hold onto it.
- steveklabnik 11y ago> it would be beneficial for the Rust book to have way more detailed info I was just talking with someone on Twitter about this today, actually. I agree with you 100%, and want to fill that kind of stuff out. You gotta pick priorities, and since we'll have more new people than experienced people at first, I've been focusing on the basics. Now that the language isn't changing all the time, shortly after 1.0, I'll be able to start writing stuff like this, that covers topics in more depth. I also think that libraries will pop up to help with this specific kind of issue, too. We'll see.
- jbooth 11y agoWhile we're making doc requests on this topic, could you address passing function pointers between C/Rust at some point? Sorry if this is already obvious to more experienced Rust users.
- steveklabnik 11y agoI don't think it's obvious at all, and yeah, absolutely.