Code Wars: Rust vs MicroPython - The Definitive Guide!

Поділитися
Вставка
  • Опубліковано 5 жов 2024

КОМЕНТАРІ • 7

  • @sval4020
    @sval4020 6 місяців тому +2

    Hey Kevin, great job comparing the two. I am learning Rust myself and would really love to see more videos of you making stuff using Rust more.

  • @CallousCoder
    @CallousCoder 6 місяців тому +2

    The number of bytes is not your actual memory usage. C always wins on memory footprint and execution footprint it so lean.
    But your code in Python maybe small but remember that even "Micro"Python still has an interpreter that consumes 600 whopping kilobytes at runtime. Also your structures are large in Python.
    You can btw reduce rust's binary footprint by not using the stdlib -- which for embedded is always clever. Also strip out the debug information and you reduce binary size.
    Zig sits nice in between Rust and C and creates small binaries very fast but I only used it in combination with a HAL on a PiPico; there's a series of 4 videos on my YT where we build a SIMON game. Zig is so new that HALs are not really available on a lot of platforms yet, so be prepared to do memory poking. But the PiPico is mostly implemented.
    Frankly I can't take MicroPython in an embedded environment serious. It's too memory hunger and slow and probably also because of it's interpreted nature more power hungery.

  • @FloodGold
    @FloodGold 6 місяців тому +2

    Too bad I missed the livestream. I'm wondering why you aren't comparing TinyGo instead of Rust since it would be a closer use case to MicroPython.

  • @AerialWaviator
    @AerialWaviator 6 місяців тому

    Learnt MicroPython turns 10 years old on May 3, 2024. Was release on this date in 2014, 11:30.
    Thanks for great overview and sample Kev. Would it be possible to create a library in Rust that can be called from MicroPython?
    This could provide best of both. More complex, performance code in Rust, but a simple to use interface in MicroPython.

  • @brehme1971
    @brehme1971 6 місяців тому

    First! 😁 Hey Kevin 😉