Conversation

Jarkko Sakkinen

Edited 11 days ago
i refershed my (c)dynlib knowledge and i got this understanding:

1. cdynlib is great because it enables e.g., audio plugins, which is actually multi-billion market. not like niche edge case such as crypto libraries but necessity for creative work.
2. dynlib is not stable and if I understand correctly both rustc version updates and also parameter configurations can lead to troubles (happy to be corrected on this with factual knowledge as I'm not 100% confident of my understanding).

So yeah to get e.g., hot-patchable crypto and stuff like that dynlib some day needs to stabilize. I've now also learned after discussing with one of ther rustc-team-member that this is actually also a distant goal, but not necessarily a "speculative goal" and that is just great. I do understand the complexity of this problem so that actually was my only expectation even if it took years.

Great that edges will be covered some day...

#rust #rustlang
1
2
1

@jarkko rlib and dylib use Rust's ABI, which is not stable, so linking libraries compiled by different compilers might not work. cdylib uses C ABI, which is stable, so it's just a regular dynamic library like you can write in C or C++. Meaning you can only use a subset of Rust for the public functions and types, since they have to be compatible with C (enums are a major pitfall, for example). And you almost always need to use unsafe.

0
0
0