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

To what extent does inline-rust allow for memory safety? #21

Open
georgewsinger opened this issue Jan 16, 2019 · 1 comment
Open

To what extent does inline-rust allow for memory safety? #21

georgewsinger opened this issue Jan 16, 2019 · 1 comment

Comments

@georgewsinger
Copy link

This is a theoretical question and perhaps not the best place to ask except I wanted to hear the author's perpsective: to what extent could one achieve memory safety (with Haskell FFI + inline-rust) if one were to

  1. Use inline-rust for all FFI calls.
  2. Avoid using any Foreign.Ptr.* calls (or any other functions) which have the capacity to manipulate pointers from outside the purview of the rust compiler.

If one followed these two rules, could one achieve memory safety in a Haskell project that uses lots of FFI?

@Qqwy
Copy link

Qqwy commented Sep 28, 2019

I think it sort of depends on what exactly you mean with 'memory safety'. Haskell's lazy nature means that you can create ridiculously large thunks that will end up never being resolved/used but might stick around in memory.

This kind of memory leaking is however also not breaking Rust's memory safety guarantees.

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

2 participants