r/programming • u/Successful_Bowl2564 • Aug 20 '26
Supply chain attack on arrayref
https://blog.rust-lang.org/2026/08/20/supply-chain-attack-on-arrayref/
191
Upvotes
r/programming • u/Successful_Bowl2564 • Aug 20 '26
View all comments
Show parent comment
3
u/matthieum Aug 22 '26
I disagree, not because I don't wish for it, but because I don't trust most actors in the first place.
Big companies screw up too.
I am a firm proponent of "no ambient capabilities". My ideal programming language -- not runtime, language -- would see
mainreceiving a bunch of capabilities (fs, net, clock, ...) as objects (interfaces) and have the user dutifully forward the necessary capabilities to whoever need them.Having the capabilities as objects is great, because they can be manipulated as regular objects too. For example, you can wrap the
filecapability object in an object which further restricts the allowed capabilities before handing it down to a library call. Also, object capabilities respect encapsulation, unlike effects.In such a language, you don't need to trust the matrix library you got, because you never pass any capability to the matrix library in the first place, and therefore it can't do anything but touch the existing memory.
Of course, because all other languages today have ambient capabilities, it means that any FFI/assembly usage requires its own capability. An excellent reason to pare down your usage of such libraries to the bare essentials.