Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

People have written drafts of a design for this for Rust. Calling it capabilities.


As a part of the language standard / standard library, or as a third party crate? I'm confused how this would work, as as far as I'm aware, making this a language-level feature would require significant changes to the ethos of the language.

There are some examples, e.g. the Bevy ECS doing more or less dependency injection for you (and ensuring against things like aliased mutable references), which is pretty neat.



Fascinating. Not sure what my opinion is of it yet.

Reminds me of implicit parameters in Scala - https://docs.scala-lang.org/tour/implicit-parameters.html

Edit: I think I like it. It doesn't solve dependency injection like e.g. Guice but the examples given, e.g. providing implementations for traits defined in external crates that take arbitrary state, is compelling.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: