Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, I've spent almost a week trying to go through compiler issues, like mismatch TypeId for the same type across projects (game DLL and engine) was a main source of headache. I did some workarounds (use UUIDs as type ids), but that wasn't enough - some libraries use `Any` trait inside to do dynamic type casting. It is done by comparing TypeIds and simple pointer type cast, but TypeId does not match across projects! Even if I would fixed those issues, I still playing with fire - everything that passing DLL boundary is a source of undefined behavior and potential crashes. So I decided to use static linking instead, as the post says, it have its own pros and cons, but at least it is super safe.

It is possible to use C ABI, via C bindings but in this case you losing all benefits that Rust provides.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: