5 ms·
With C++ even if your project follows this, there is no way to enforce this across your project's dependencies & wider eco-system. With Rust, its entire ecosys
by sudeepj 7y ago
With C++ even if your project follows this, there is no way to enforce this across your project's dependencies & wider eco-system.
With Rust, its entire ecosystem (however nascent) is subjected to the same strict rules. This is big plus when Rust eco-system matures functionality wise.
- akling 7y agoMy project doesn’t have this issue ;) https://github.com/SerenityOS/serenity https://github.com/SerenityOS/serenity
- nerdponx 7y agoThis looks great! I'm going to try this out over the weekend.
- logicprog 7y agoWait, we enforce borrow checking rules on SOS?
- akling 7y agoAt the moment it only shows up as an on-screen warning in my Qt Creator thanks to its clang integration. The default Serenity toolchain is using GCC-8.3.0 which doesn't support this trick at all, so we don't get any compile-time enforcement. :( I keep thinking about switching over to a clang toolchain to be able to do more stuff like this.
- tfha 7y agoSure you can. Just reject any dependencies that don't pass your own linter. By switching to rust, you are doing the same thing anyway.
- dpc_pw 7y agoBut with Rust you will get a whole ecosystem working. In your method you will get 0 dependencies working, no?
- paulddraper 7y agoSame as the Rust ecosystem a few years ago.
- damnyou 7y agoAnd not the same as the Rust ecosystem today.
- patrick5415 7y agoIf the rust people took your attitude a few years ago, where would they be today?
- damnyou 7y agoThey would hopefully have realized that Rust is a much better language than C++ and not taken that attitude.
- msbarnett 7y agoIs the assumption here that you're recompiling and statically linking all of your dependencies?
- nonbirithm 7y agoThat's one of the benefits of designing the language such that using it normally forces people to share valuable information about programs without them knowing it. A somewhat related example is how Emacs was built to support introspective programming, where nearly anything can be inspected to provide a docstring. This is both invaluable when extending the editor and only possible because Emacs established conventions early on about documenting public objects. Though it isn't obligatory to document things, the audience Emacs appeals to seemed to keep doing so through force of momentum over the years. I find this momentum incredibly important to have. The problem is you can't just shoehorn this way of thinking onto any arbitrary language/programming environment, because the issue of dependencies following whatever code annotations they have arises. For C++ it's hopeless to imagine we can expect these annotation benefits to be universal because using the language didn't obligate adding them in some way, so the vast majority of people didn't. The author mentions there aren't even any real-world codebases using them. Every corner of the system/language has to be designed from the beginning with annotation in mind. I've been pining over the same issue as I'm trying to design a "living system" that supports user extension. I'm still wondering if I'm missing anything that could help with introspection, is not detrimental to user experience and can only be added in the nascent stage the project is in. Once all the conventions are in place, everything will have to be built on top of them no matter how imperfect they are.
- coldtea 7y agoOn the other hand the Rust ecosystem is insignificant (size and adoption wise) compared to the C++ ecosystem, so there's that...
- stirfrykitty 7y agoRust is also fairly nascent. If/when more people use it for serious projects, it will mature and get more features. I've been meaning to start learning it, but life gets in the way.
- gaogao 7y agoIn my opinion, it's hit the inflection point at Facebook. The new shiny, Libra, is written mostly in Rust.