Skip to content

Commit 3628fd2

Browse files
author
B Vadlamani
committed
update_readme_per_review_comments
1 parent 27738af commit 3628fd2

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

datafusion/ffi/README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,27 @@ by this crate, but that is currently not supported.
7676
## Stabby Usage
7777

7878
This crate uses [stabby] for ABI-stable types like `stabby::string::String` and
79-
`stabby::vec::Vec`. We chose stabby because [abi_stable] is no longer actively
80-
maintained.
79+
`stabby::vec::Vec`.
8180

8281
We intentionally use `#[repr(C)]` for our struct definitions instead of stabby's
83-
`#[stabby::stabby]` macro. The reason is that stabby's `IStable` trait (required
84-
by the macro) demands that all inner types also implement `IStable`. This creates
85-
challenges for our use case:
82+
`#[stabby::stabby]` macro for the following reasons:
8683

87-
1. **Arrow types**: Arrow's FFI types like `FFI_ArrowSchema` do not implement
88-
`IStable`, and adding such implementations would be laborious and error-prone.
84+
1. **Build time**: The heavy macro use greatly increases build time, especially
85+
given our many interdependent types.
86+
87+
2. **Code complexity**: Creating stabby dyn pointers for trait objects leads to
88+
more complex code patterns with very little added benefit.
8989

90-
2. **Self-referential function pointers**: Many of our FFI structs contain
91-
function pointers that reference `&Self`, which complicates `IStable`
92-
implementations.
90+
3. **Arrow types**: Arrow's FFI types like `FFI_ArrowSchema` do not implement
91+
`IStable`, and adding such implementations would be laborious and error-prone.
9392

94-
3. **FFI_Option and FFIResult**: For similar reasons, we provide our own
95-
`FFI_Option<T>` and `FFIResult<T>` types using `#[repr(C, u8)]` instead
96-
of stabby's `Option` and `Result`, which require inner types to be `IStable`.
93+
4. **FFI_Option and FFIResult**: We provide our own `FFI_Option<T>` and
94+
`FFIResult<T>` types using `#[repr(C, u8)]` because stabby's `Option`
95+
and `Result` require inner types to be `IStable`.
9796

98-
This hybrid approach gives us stabby's maintained, ABI-stable collection types
99-
while retaining flexibility for our complex FFI struct layouts.
97+
Instead, we use stabby for its convenient ABI-stable collection types like
98+
`stabby::string::String` and `stabby::vec::Vec`, while retaining flexibility
99+
for our complex FFI struct layouts.
100100

101101
## FFI Boundary
102102

0 commit comments

Comments
 (0)