2 ms·
This is why I love writing libraries in Rust: the language provides so many ways of protecting users of your library to shoot themselves into the foot. Combine
by atoav 7y ago
This is why I love writing libraries in Rust: the language provides so many ways of protecting users of your library to shoot themselves into the foot.
Combine this with the built in and easy to use testing and I find myself often to break out core functionality of my applications into libraries just because it is a sane way to keep things decoupled.
This is far harder in languages without a strict type system: you can do everything right and your users still abuse it.
- DmitryOlshansky 7y agoWell I’m long time D language user and we had unit-tests built-in from 2005+ (if not earlier - I started in 2010). It all helps but never eliminates the problem completely.
- DmitryOlshansky 7y agoAlso to destroy your point on Rust making it safe for your end users. Library that doesn’t have stable C API is next to useless outside of its original language/community/etc. and I have been bitten by this a few times already myself (my great libraries in D’s std cannot be easily exported outside of D). Do not repeat my mistakes - provide stable C API (and ABI by extension) as soon as you can. You cannot make it safe though it’s simply not accounted for in the land of linker “technology”.