logoalt Hacker News

zephentoday at 2:26 AM1 replyview on HN

> someone writing a library with a costly abstraction

That's not what happened here.

> it's not like C++ doesn't have some costly abstractions

This is simultaneously both completely orthogonal to my observation that the Rust FFI is borked, and a great example of a problem that wouldn't happen in C++, because in C++ you could completely ignore the costly abstractions if necessary.


Replies

saghmtoday at 2:34 AM

> > someone writing a library with a costly abstraction

> That's not what happened here.

Yes it is. Where do you think the `FFISafe` type that they used came from? It's not anything inherent to how Rust does FFI; it's a type someone wrote in an attempt to try to provide an abstraction, and that abstraction happened to have a cost. There's absolutely no reason anyone has to use it in order to do FFI in Rust.

show 1 reply