-
‹ Home
Contents
-
Categories
-
Tags
-
Archives
- November 2025
- April 2025
- March 2025
- December 2024
- November 2024
- October 2024
- August 2024
- July 2024
- September 2023
- July 2023
- May 2023
- April 2023
- March 2023
- January 2023
- November 2022
- September 2022
- July 2022
- October 2021
- November 2020
- June 2020
- May 2020
- March 2020
- July 2019
- June 2019
- May 2019
- March 2019
- January 2019
- December 2018
- November 2018
- October 2018
- August 2018
- July 2018
- June 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- August 2017
- June 2017
- April 2017
- March 2017
- January 2017
- August 2016
- July 2016
- April 2016
- March 2016
- January 2016
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- August 2012
- June 2011
- May 2011
-
RSS Feeds
-
Meta
Dealing with the Rust
Rust is a up-and-coming programming language, developed by the Mozilla Foundation, and is used in the Firefox rendering engine, as well as the Node Package Manager, amongst others. There is a lot to say about Rust; suffice it to say that it’s designed to be memory-safe, fast (think: C or better), it can compile to WebAssembly, and has been voted “most loved language” on StackOverflow in 2017 and 2018. As far as new-ish languages go, this is one to keep an eye on.
Rust comes with a fantastic package manager, Cargo, which, by default, uses crates (aka libraries) from crates.io, the central repository for Rust code. As part of my personal and professional attempt at grasping Rust (it has a bit of a learning curve), I wrote a tiny crate to access the API of MediaWiki installations. Right now, it can
- run the usual API queries, and return the result as JSON (using the Rust serde_json crate)
- optionally, continue queries for which there are more results available, and merge all the results into a single JSON result
- log in your bot, and edit
This represents a bare-bones approach, but it would already be quite useful for simple command-line tools and bots. Because Rust compiles into stand-alone binaries, such tools are easy to run; no issues with Composer and PHP versions, node.js version/dependency hell, Python virtualenvs, etc.
The next functionality to implement might include OAuth logins, and a SPARQL query wrapper.
If you know Rust, and would like to play, the crate is called mediawiki, and the initial version is 0.1.0. The repository has two code examples to get you started. Ideas, improvements, and Pull Requests are always welcome!
Update: A basic SPARQL query functionality is now in the repo (not the crate – yet!)