Learning Rust, week 1

I'm trying to learn Rust this summer. I've found I learn languages the best by just trying to do something in it, figuring out the building blocks as I go along. So I plan on writing/porting different projects to Rust.

This week I set up rustup, installed the stable and nightly toolchains and started getting familiar with cargo/the build system.

I ported my newusers Toolforge tool to Rust. It's a simple web server with a single route that makes an API request, and dumps the output in plaintext.

I picked the rocket framework because it seemed more straightforward and similar to Python's Flask compared to hyper, but it was a bit weird to me that it required a nightly build of Rust to compile and run (though it's apparently about to change). I also used Magnus's mediawiki crate mostly to see what it was like, this API request was so simple I didn't really need any MediaWiki-specific code. Thank you to qedk in #wikimedia-tech who helped work around a dependency issue I ran into.

I also wrote up an analysis of supporting Rust tools on Toolforge in the future.

Code written:

Libraries used:

Concepts learned:

Next week:

  • Writing a command-line tool.



MediaWiki packages for Ubuntu 20.04 Focal available

Packages for the MediaWiki 1.31 LTS release are now available for the new Ubuntu 20.04 LTS "Focal Fossa" release in my PPA. Please let me know if you run into any errors or issues.

In the future these packages will be upgraded to the MediaWiki 1.35 LTS release, whenever that's ready. It's currently delayed because of the pandemic, but I expect that it'll be ready for the next Debian release.