Live data from Hacker News

Rust on Espressif chips

mabez.dev

51–60 of 71 posts

Re: Rust on Espressif chips

#51
I am toying with SPARK on smaller chips. You can gradually replace parts of C code, like I think you can in Rust too, and work up to doing full-scale replacement or projects from scratch with SPARK on embedded devices, which has a lot of the benefits of Rust and then some[1][2]. I am a polyglot with certain biases/strengths in some PLs over others, so perhaps my early 80s experience with Pascal makes Ada/SPARK2014 easier for me than Rust. I understand the Ada/SPARK concepts better. I think Zig[3] will also become more popular on embedded devices for existing C programmers because its a smaller jump to make than in learning Rust, at least that has been my experience. I also enjoyed reading "Building High Integrity Applications with SPARK" which involves the , and maybe if there were a similar book for Rust, I would attempt Rust again. Because SPARK is "a formally analyzable subset of Ada 2012", it benefits from Ada's age. VTC (Vermont Technical College) launched a Cubesat into orbit on November 19, 2013 running SPARK. Rust and SPARK/Ada have been cross pollinating each other with advances in software integrity which is a win-win scenario.

[1] https://blog.adacore.com/ada-on-the-esp8266

[2] https://blog.adacore.com/how-to-prevent-drone-crashes-using-...

[3] https://ziglang.org/

Edit: I hope Amazon's involvement in Rust helps it to mature.

Re: Rust on Espressif chips

#52
post #22

Earlier quoted context omitted.

Well not to be inflammatory, but aren't you making your life more difficult by doing development on Windows? You could just run Windows in a VM if you need any Windows specific software, and have your main OS be something more suitable for software development. Of course ideally everything would just work on Windows, and there's nothing wrong with running Windows as your main os, but the reality is that especially bl…

I'm not sure of the situation with ESP but in many embedded environments you HAVE TO use Windows for development.

Not the situation for ESP, but the C++ pain is real. Once that is sorted, it works great on mac.

Re: Rust on Espressif chips

#53

Earlier quoted context omitted.

"low-latency processing of IO input" may well be talking about hard realtime stuff, for which threads/async on a single core doesn't help you.

They do help, hard realtime only means that there can be no blocking (critical) section with a possible unbound time limit, toggling an IO register with a lower frequency as the CPu clock can still be done while shovelling in datagrams into the RF stack that can DMA acces in withput any CPu doings anyway..

i agree it can be done but it's a fragile balancing act. What I don't agree with is that Rust provides anything particularly special allowing you to do this.

Re: Rust on Espressif chips

#54
post #24
post #20

as someone who occasionally dabbles in diy esp based home automation devices (mostly with esp8266) but completely new to Rust, where's the best place to get started? some code example to look at?

This repository was linked in the author's first post: https://github.com/ivmarkov/rust-esp32-std-demo

excellent! really useful, thank you!

Re: Rust on Espressif chips

#55
post #22
post #4

I was looking forward to trying Rust on my ESP32 projects but always had a hard time. All the tooling is too complicated. There is flasher coded in python, IDF coded in C, you need to run MinWin on Windows which makes it even harder. You can't run all of this in docker because docker for windows doesn't allow mapping COM ports into container and stuff. Everything about just compiling a code seems so tiresome and unst…

Well not to be inflammatory, but aren't you making your life more difficult by doing development on Windows? You could just run Windows in a VM if you need any Windows specific software, and have your main OS be something more suitable for software development. Of course ideally everything would just work on Windows, and there's nothing wrong with running Windows as your main os, but the reality is that especially bl…

I've found the Rust embedded tooling is equivalent on Windows and Linux. Ie the same tools and programs work, and in (almost) the same way. More broadly, Windows is more popular for embedded. My anecdote here is limited to Cortex-M.

Re: Rust on Espressif chips

#56
post #22
post #4

I was looking forward to trying Rust on my ESP32 projects but always had a hard time. All the tooling is too complicated. There is flasher coded in python, IDF coded in C, you need to run MinWin on Windows which makes it even harder. You can't run all of this in docker because docker for windows doesn't allow mapping COM ports into container and stuff. Everything about just compiling a code seems so tiresome and unst…

Well not to be inflammatory, but aren't you making your life more difficult by doing development on Windows? You could just run Windows in a VM if you need any Windows specific software, and have your main OS be something more suitable for software development. Of course ideally everything would just work on Windows, and there's nothing wrong with running Windows as your main os, but the reality is that especially bl…

In general, Rust development on Windows, including at least the embedded platforms I work with (ARM), is identical to Linux or Mac.

Re: Rust on Espressif chips

#57
post #22

Earlier quoted context omitted.

Well not to be inflammatory, but aren't you making your life more difficult by doing development on Windows? You could just run Windows in a VM if you need any Windows specific software, and have your main OS be something more suitable for software development. Of course ideally everything would just work on Windows, and there's nothing wrong with running Windows as your main os, but the reality is that especially bl…

I'm not sure of the situation with ESP but in many embedded environments you HAVE TO use Windows for development.

I do ESP and ARM (NRF52) dev on Linux with no issues. I haven't had a chance to try the Paduak tools under Wine yet.

Re: Rust on Espressif chips

#58
post #22
post #4

I was looking forward to trying Rust on my ESP32 projects but always had a hard time. All the tooling is too complicated. There is flasher coded in python, IDF coded in C, you need to run MinWin on Windows which makes it even harder. You can't run all of this in docker because docker for windows doesn't allow mapping COM ports into container and stuff. Everything about just compiling a code seems so tiresome and unst…

Well not to be inflammatory, but aren't you making your life more difficult by doing development on Windows? You could just run Windows in a VM if you need any Windows specific software, and have your main OS be something more suitable for software development. Of course ideally everything would just work on Windows, and there's nothing wrong with running Windows as your main os, but the reality is that especially bl…

>bleeding edge software development tools will never be as good on Windows as they are on Linux or MacOS

Personally, I've never experienced any better IDE than Visual Studio. I would call it bleeding edge.

Re: Rust on Espressif chips

#59
post #22
post #4

I was looking forward to trying Rust on my ESP32 projects but always had a hard time. All the tooling is too complicated. There is flasher coded in python, IDF coded in C, you need to run MinWin on Windows which makes it even harder. You can't run all of this in docker because docker for windows doesn't allow mapping COM ports into container and stuff. Everything about just compiling a code seems so tiresome and unst…

Well not to be inflammatory, but aren't you making your life more difficult by doing development on Windows? You could just run Windows in a VM if you need any Windows specific software, and have your main OS be something more suitable for software development. Of course ideally everything would just work on Windows, and there's nothing wrong with running Windows as your main os, but the reality is that especially bl…

As sibling says, for embedded toolchains Windows is often the best supported platform.

Re: Rust on Espressif chips

#60
post #23

Earlier quoted context omitted.

I don’t see Rust becoming mainstream in the enterprise layer anytime soon. 90% or enterprise software consists of a REST API getting JSON payloads and saving them in a DB. The most complex part is often managing the “bus factor”, rather than some technical challenge. You often need just a bit more than VB6. Rust requires a higher cognitive cost than C# or Python, but doesn’t provide massive improvements in the areas…

All of the areas you mention as relevant to enterprise developers are things that require libraries written, potentially with APIs that lean less in the "high performance" and more on "easy to use/hard to misuse", not fundamental changes to the existing language or tooling. I personally think that the big surprise with Rust will be how flexible it can be, covering a wider range of use cases than it might look at firs…

Though dependency management is quite easy to manage in rust (as with many high level languages) whereas I would argue dependency management isn't as simple in C/C++ which should boost library consumption and creation.

I know depending on boost or qt might be really easy, but the amount of different toolsets you must know to depend on randomlib is too damn high. I wish though that it doesn't end up like npm, I also hope there'll be some kind of "meta standard library" which integrates different mainstream building block libraries into something that's easy to consume coherently.

Post reply on HN