4 comments

  • dgacmu 48 minutes ago
    Authors are from STMicro, polytechnic Turin, Freie universitat Berlin, and Inria. Examined writing firmware for an IOT sensor platform. From the abstract:

    > Two teams concurrently developing the same functionality (one in C, one in Rust) are analyzed over a period of several months. A comparative analysis of their approaches, results, and iterative efforts is provided. The analysis and measurements on hardware indicate no strong reason to prefer C over Rust for microcontroller firmware on the basis of memory footprint or execution speed. Furthermore, Ariel OS is shown to provide an efficient and portable system runtime in Rust whose footprint is smaller than that of the state-of-the-art bare-metal C stack traditionally used in this context. It is concluded that Rust is a sound choice today for firmware development in this domain.

    • noosphr 13 minutes ago
      That's great for today. What about in 5 years?

      Rust is evolving far too fast to be used in code which needs to run for years to decades down the line.

      • jagged-chisel 6 minutes ago
        The code won't magically stop running because the Rust community continued evolving the language. The old toolchains will be available if there's a compatibility change.

        Where's the problem exactly?

      • staticassertion 12 minutes ago
        > Rust is evolving far too fast to be used in code which needs to run for years to decades down the line.

        That statement deserves support.

      • estebank 3 minutes ago
        Can you point at any piece of code from 5 years ago that doesn't work today?
      • lawn 4 minutes ago
        Are you implying Rust will stop working or something?
  • kaspar030 43 minutes ago
    One of the author's here, if there are any questions!
    • edderly 6 minutes ago
      If memory is a concern why are you trying to send JSON to a memory limited device?
    • Galanwe 38 minutes ago
      Isn't there a nasty selection/volunteer bias at play with the developers?
      • kaspar030 34 minutes ago
        You mean with the "two teams" that were tasked to develop the C / Rust versions?

        Yeah of course. Then again - they were one person teams, where the C "team" had years of experience in stm32 / embedded C / stm32 cube development and churned out that handwritten state machine in just days. The Rust "team" was a pre-masters intern with only minimal embedded Rust experience. They ran into all the pitfalls with (async) embedded Rust, but corrected towards the end.

        • jacquesm 22 minutes ago
          That does not seem like even close to a fair comparison and makes me wonder how valid the conclusion is. Effectively this is two times n=1, if you use 'teams' when you actually mean 'individuals' then that's not really proper reporting.

          I do applaud you for having the same work done twice but it would have been far more meaningful to have two actual teams of seasoned developers do this sort of thing side-by-side. The biggest item on the checklist would be the number of undiscovered UB or UB related bugs in the C codebase and to compare that with the Rust codebase on 'defect escape rate' or some other meaningful metric.

          • pitched 8 minutes ago
            I think there’s another hidden issue of testing how new devs use the language vs. those seasoned devs. I expect someone with a few months of experience would prefer Rust (fewer footguns) but someone with more experience would prefer C (the sharper knife). The flavour of the thing changes as we age.
    • MeteorMarc 34 minutes ago
      Nice to see serial comms supported. Are I2S and CAN on the roadmap? Do you see any sensor module suppliers support ArielOS?
      • kaspar030 28 minutes ago
        1. So Ariel OS is based on Embassy - IIUC I2S and CAN has some support upstream. That can be used already, although not using Ariel's usually fully portable APIs.

        2. Well, ST has released official Rust drivers for a bunch of their sensors. They're built on embedded-hal(-async), so can directly be used with Ariel OS. There is probably more.

    • Ygg2 41 minutes ago
      Why Rust and not say Ada?
      • kaspar030 38 minutes ago
        "Customers are asking for Rust" would probably be the reason why ST is looking into this.
  • serhack_ 36 minutes ago
    off topic question: why is there no source attached to this paper?
  • cmrdporcupine 41 minutes ago
    I'm a big fan of Rust on embedded (and think embassy in particular is awesome, haven't tried this Ariel OS.)

    I would say however that there's still toolchain issues here. There all kinds of MCUs that simply don't/won't have a viable compiler toolchain that would support Rust.

    e.g. I recently came from a job where they built their own camera board around an older platform because it offered a compelling bundle of features (USB peripheral support and MIPI interface mainly). We were stuck with C/C++ as the toolchain there, as there was no reasonable way to make this work with Rust as it was a much older ARM ISA