Skip to content

Learn unsafe Rust: Provide initial content for the chapter "ABI and FFI" #150

Open
@darkwisebear

Description

@darkwisebear

Todo

Provide initial content for the ABI and FFI chapter of the Learn unsafe Rust book.

Proposed content

  • Explain ABI and what "C ABI/FFI" actually means
    • What aspects of the ABI are defined by C and which aren't
    • How compilers and compiler settings influence the ABI
    • What aspects are influenced by the ABI
    • Mismatching calling conventions / padding (aka ABI)
    • Note on different calling conventions, esp. on x86
  • Explain unsafety categories in FFI
    • Explain main building blocks of the Rust FFI
    • Mismatching function signatures
    • Mismatching type declarations
    • Unsafe actions beyond the FFI boundary
    • Moveability/self-reference, especially with C++ move constructors
    • Ownership
    • C++ topics
      • Dealing with standard library data structures
      • Exceptions thrown from C++ code
  • Mitigations for FFI unsafety
    • Existing FFI tooling (bindgen, cbindgen, cxx)
    • Checks that can be done on FFI and Rust side
    • cRABI (?)

Metadata

Metadata

Assignees

Labels

coding guidelinesRelated to work in the Coding Guidelines Subcommitteetracking issueAn issue that gathers activities toward a larger goal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions