From: Ian Jackson Date: Wed, 15 May 2019 15:01:26 +0000 (+0100) Subject: wip X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=64dbb53cd58486115ab5838f44297a0e31074423;p=talk-2019-ghm-rust.git wip --- diff --git a/talk.txt b/talk.txt index 20eb942..fd2636b 100644 --- a/talk.txt +++ b/talk.txt @@ -134,3 +134,108 @@ are not known to the Rust compiler so you must check them yourself.) Built on top of that are machineries for glueing Rust to, for example, Python. +D======================================================================D + +I also want to talk a bit about the attitudes and values of the Rust +project. (I should say that this is an outsider's point of view.) + +[ slide with quotes from C vs Rust ] + +The most impressive thing, for me, is that the Rust community does not +blame Rust programmers for the bugs in Rust programs. Rather, they +look for opportunities to help the programmer avoid bugs. There is a +clear design ethos, to make APIs where the default and easy option +does the right thing, and to avoid beartraps. + +In particular, the comparison with C is very striking. The C +community have even resorted to writing compilers which ferociously +analyse your program for violations of C's bizarre and +nigh-incomprehensible rules, and then use those rule breaches as +excuses to miscompile your program. + +Convenience is not regarded as the enemy of correctness, but its ally. + +[ slide with interface stability ] + +The Rust project is quite careful about language and library +stability. They make a clear distinction between stable and unstable +features, and try quite hard to avoid backward-incompatible changes to +anything which has been declared as stable. + +[ process and code of conduct ] + +There's a mature process for evaluating and deciding on new features, +and a modern Code of Conduct. + +E======================================================================E + +Of course nothing is perfect. I'm very critical by nature, so I often +find things to gripe about. + +The most obvious difficulty with Rust, if you read the internet, is +some's feeling they are constantly fighting the borrow checker. +Personally I have not found this to be a problem at all. I think it +may depend on how much experience of informal object ownership systems +you have - in particular, how much C and C++ you've done. + +Of course having something like the borrow checker is the price Rust +pays for its novel memory management strategy, and it is that novel +strategy that makes for the high performance of Rust programs. + +There is one annoyance that occurs when trying to design and implement +complex APIs. It is not straightforward to define an object type one +of whose members is (or contains) a reference to another member. +Luckily this doesn't come up very often, and it is still possible to +hide the issue from the API's consumer. The awkwardness is tolerable. + +Rust does have macros. In fact it has two ways to define macros (one +built on top of the other). The more sophisticated macro system is +very capable and has been used to really impressive effect. But it's +hard to use casually; and the simpler macro definition facility is +simultaneously too complicated and underpowered. So casual macro use +is slightly awkward. + +But the worst problem is cargo. Cargo is Rust's language-specific +package manager and build tool. It is really quite annoying. + +The worst problem is that like all modern tools of this kind, its main +purpose is to automatically download stuff from the internet and run +it. Apparently this is what is expected by the youth of today. It +can be hit hard enough to stop it doing this, but you still run into +the difficulty that if you use one library from the repository, you +end up having to trust much more widely than ideal. And at least +Rust's repository contains larger libraries than, say node.js's, so +the number of people you're trusting is much lower. + +Also, as a build tool, cargo can be very inflexible. Despite an +official policy that cargo should be suitable for running inside +another build systme, requests to be able to do `weird stuff' seem +usually to result in excuses why the thing you want to do is a bad +idea, rather than useful increases in flexibility. (And the excuses +are usually based on misunderstandings.) I guess if your project ends +up containing piece of opinionated curl-pipe-bash-ware, you should +expect a culture which produces these kind of problems. + +F======================================================================~ + +Despite these difficulties, and of course a fair few minor +irritations, I have found programming in Rust to be both fun and very +productive. + + + + + + + + + +not +very good either. + + + +Unlike many other modern programming language ecosystems, the Rust +project and its community have a welcoming, cautious and mature feel. + +The