flipperdevices / flipperzero-firmware

Flipper Zero firmware source code
https://flipperzero.one
GNU General Public License v3.0
11.83k stars 2.61k forks source link

Support for writing applications in Rust 🦀 #1783

Closed dcoles closed 1 year ago

dcoles commented 1 year ago

As an application developer, I want to be able to write applications for the Flipper Zero in Rust.

Initially it's going to be easiest to support [#no-std] applications, but the long-term goal would be to also support the Rust standard library.

Roadmap

Anything else?

Rust for Flipper Zero now has its own GitHub project: dcoles/flipperzero-rs

skotopes commented 1 year ago

At this point we don't plan to support rust.

But we are going to accept PRs with some conditions:

dcoles commented 1 year ago

@skotopes Hi! Thanks for the information. I wanted to make sure there was an feature request, since I'm sure there will be others interested.

Rust tends to statically link the runtime/standard library, so there's no need to add support into the firmware. Which is fine if this is just for external applications on the SD card.

Since we don't want to officially support Rust, I'll create a new GitHub project for Rust bindings to the Flipper Zero and push that to crates.io. Developers of external applications can add this as a dependency to make it easier to call Furi and services API.

dcoles commented 1 year ago

Created dcoles/flipperzero-rs and published initial flipperzero and flipperzero-sys crates.

dcoles commented 1 year ago

I think we can safely close this now that there's flipperzero-rs/flipper-zero.

While std support is probably possible, I'm not sure it's worth the trouble at present (the Flipper Zero SDK is distinct enough from a Unix-style platform that it would require a full port).

skotopes commented 1 year ago

@dcoles Good job guys, really awesome to see such achievements.

dcoles commented 1 year ago

@skotopes Thanks! The SDK support has certainly made life a lot easier. The main challenge now is making the Clang-based bindgen play nicely with the toolchain. Once that's reasonably stable, then we can make the flipperzero-sys crate support multiple SDK versions so folks don't have to wait for me to regenerate the bindings.