Rust

  1. Vendoring Rust dependencies for a Debian derivative

    By Andrej Shadura

    Recently, I needed to package a Rust crate libslirp for a Apertis, a Debian derivative. libslirp is used by the newly release UML backend of debos, our Debian image build tool. Unfortunately, this crate hasn’t yet been properly packaged for Debian proper, so I could not simply pull the packaging from Debian. Even worse, its build dependencies haven’t all been packaged yet. Most importantly, I have only uploaded zbus to Debian today, and at that time none of its dependencies were in Debian either.

  2. Rust-like enums in Kotlin

    By Andrej Shadura

    Rust has an exciting concept of enumeration types, which is much more powerful than enums in other languages. Notably C has the weakest type of enum, since there’s no type checking of any kind, and enum values can be used interchangeably with integers:

    :::c
    enum JobState {
        PENDING,
        STARTED,
        FAILED,
        COMPLETED
    };
    

    You can opt for manually assigning integers instead of leaving this to the compiler, but that’s about it.