3 ms·
As for "capabilities", I'm not sure I fully understand how that is advantageous to the convention of passing the helper function ("capability") as an argument t
by bruce343434 2y ago
As for "capabilities", I'm not sure I fully understand how that is advantageous to the convention of passing the helper function ("capability") as an argument to the "capable" function.
For instance, in Zig, you can see that a function allocates memory (capability) because it requires you to pass an allocator that it can call!
I'd like to see if others are more creative than me!
- spencerflem 2y agoThat's pretty much how it plays out, as I understand it. The trick is making sure that that object is the Only possible way to do the thing. And making more features like that, for example Networking, or File I/O, etc
- do_not_redeem 2y agoIn Zig it's conventional to pass an allocator, but any code can end run around the convention by reaching for page_allocator or c_allocactor behind your back. Capabilities upgrade that convention into a guarantee.