chiark / gitweb /
bookkeeping
[talk-2019-ghm-rust.git] / talk.txt
index a25bddb2bde64e91c0109f3c0ba703e3a86c6d74..d9a798815a3c5ff13525cc936a15d043a80e2bd8 100644 (file)
--- a/talk.txt
+++ b/talk.txt
@@ -3,7 +3,7 @@
 
 Hi.  This talk is going to be, mostly, a plug for Rust.
 
-Those of you who know me may find this surprising.  After all Rust in
+Those of you who know me may find this surprising.  After all, Rust in
 its current form is only about 4 years old, and I myself only learned
 it in December.  I'm not known for liking new things :-).  All I can
 say is that I tried it and have been impressed.
@@ -98,7 +98,7 @@ be very fast.
 
 C======================================================================C
 
-[ overview slide? | syntax ]
+[ tour - syntax ]
 
 Apart from the ownership system, there is little new in Rust.
 Nevertheless, it is an advanced language with a lot of expressive
@@ -110,20 +110,11 @@ to feel quite familiar.  I have found it easy to learn and to use.
 
 I'm going to zoom through a few of Rust's most important properties:
 
-[ syntax | safety ]
-
 Rust's syntax is a conventional structure of curly braces, keywords,
 parentheses, and infix expressions.  It looks a lot like C or
 JavaScript or something.
 
-[ safety | type ]
-
-Rust is safe by default.  That is, bugs in your code can't corrupt
-memory the way that they do in C and C++.  But, unlike most other safe
-languages, if you really want full manual control, you can write
-`unsafe'.  This is rarely needed, even if you want really fast code.
-
-[ type | inference ]
+[ tour - type annotations ]
 
 Rust is statically typed.  The compiler will typecheck it.  This is
 great.  You may have heard Haskell and Ocaml programmers say "once you
@@ -133,17 +124,24 @@ algorithm you can type some drivelous pseudocode into your text
 editor.  Then keep fixing errors until it builds and lo! it will often
 work.
 
+[ tour - type inference & polymorphism ]
+
 Rust also has type inference (similar to Ocaml, Haskell, etc.), so you
 can often leave out the type annotations.
 
-[ polymorphism ]
-
 Rust supports polymorphism (also known as `generics'; it calls the
 feature `traits'.  They're a bit bit like C++ templates, but not mad.
 Rust supports dynamic dispatch (like `virtual' in C++), or static
 dispatch, but in both cases the typechecking is done at compile time.
 
-[ unsafe Rust/C/C++ example, chrobakpayne.rs glue.cpp ]
+[ tour - safety ]
+
+Rust is safe by default.  That is, bugs in your code can't corrupt
+memory the way that they do in C and C++.  But, unlike most other safe
+languages, if you really want full manual control, you can write
+`unsafe'.  This is rarely needed, even if you want really fast code.
+
+[ tour - unsafe Rust/C/C++ example, chrobakpayne.rs glue.cpp ]
 
 Rust has a reasonably good system for interfacing to code written in
 other languages.  With the appropriate annotations, you can call C
@@ -239,9 +237,10 @@ 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
+end up having to trust much more widely than ideal.  At least
 Rust's repository contains larger libraries than, say node.js's, so
-the number of people you're trusting is much lower.
+the number of people you're trusting is much lower, but it's still
+troublesome.
 
 Also, as a build tool, cargo can be very inflexible.  Despite an
 official policy that cargo should be suitable for running inside
@@ -252,9 +251,28 @@ 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.
 
+[ other problems ]
+
+Rust does not currently readily support dynamic linking between Rust
+modules.  This is something the Rust community know they need to work
+on but it hasn't been their priority.  Some of Rusts's language design
+choices make this challenging, although not impossible.  In particular
+the very nice system of generics.  Personally I like the tradeoff that
+Rust has made here.  I expect that some form of dynamic linking or
+partial compilation will very likely appear eventually.  But in the
+meantime there are places where replacing C with Rust is awkward.
+
+Rust depends on LLVM.  So its architecture support for smaller
+architectures (with less money behind them) is poor.  From my point of
+view as a Debian contributor a particular problem is the lack of an
+m68k backend for LLVM.  But it provides a more general difficulty with
+supporting a wide set of embedded architectures, which Rust would
+otherwise be very suited to.
+
+
 F======================================================================~
 
-[ rust-lang, ian.jackson@ ]
+[ rust-lang, ijackson@ ]
 
 Despite these difficulties, and of course a fair few minor
 irritations, I have found programming in Rust to be both fun and very