4 ms·
Thank you for the example, that helps a lot. So for example, when you write a library that need capabilities, you would write it using dependency (capability?)
by Zababa 5y ago
Thank you for the example, that helps a lot. So for example, when you write a library that need capabilities, you would write it using dependency (capability?) injection, and then the main program would have to pass an object with that capability for the code to work? And I see what you mean by "they are just plain values, and require nothing special from the type system", as long as you restrict what part of the program can produce a System or a FileSystem, you can just use plain typechecking.
- continuational 5y agoYes, dependency injection (without DI frameworks) is pretty much what it is! Just taken a bit further to the logical conclusion. I would point to an online resource, but honestly I haven't run across any that does justice to the simplicity of the concept.
- Zababa 5y agoI'd say our conversation right here is a good example. Most people understand static typing, most people understand DI. Once you have those, the only part left to understand is the concept of capabilities. If you have all of those, your example is clear and simple. Maybe adding a type annotation to show that fs is a FileSystem in main, but that's about it. I think you've done a good job of minimizing what's required for the average developer to go from not knowing about capabilities to using them.
- continuational 5y agoGreat! Maybe I can ask for your feedback once we've produced some documentation?
- Zababa 5y agoYes, I would be very interested. My email address is in my profile.