TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

This Year in Embedded Rust

144 pointsby eldruinover 3 years ago

8 comments

zibzabover 3 years ago
Two things have kept me away from embedded Rust before<p><pre><code> 1. A huge chain of dependencies. Security issues aside, I prefer my embedded code to be lean and clean. 2. A big departure from how things used to be done in this world. For example interrupt handlers almost look like AWS lambda code to me. Maybe that&#x27;s the future, I don&#x27;t know. But right now I am not comfortable with this way of doing low level coding. </code></pre> But I am keeping an open mind and will probably try it again soon.<p>I can see myself using Rust instead of C in more projects, but maybe first after things calm down a bit. I want my development environment outdated and boring, a.k.a. &quot;stable&quot;.
评论 #29723720 未加载
评论 #29724027 未加载
评论 #29723732 未加载
评论 #29723575 未加载
AlexanderDhooreover 3 years ago
I really hope embedded rust can become the next rock-solid foundation. I need my code to build&#x2F;run today and also in 10 years. We have code in our codebase from at least the early 90s but I suspect it&#x27;s older than that.<p>I went into embedded because I really despise the code churn of higher level frameworks&#x2F;languages. &quot;We just released Qt5! Good luck rewriting your code.&quot;
评论 #29723409 未加载
评论 #29723383 未加载
评论 #29724834 未加载
berkutover 3 years ago
One of the things I really find limiting in Rust compared to C&#x2F;C++ is conditional compilation, i.e. for different architectures: yes, the C&#x2F;C++ pre-processor does suck in many ways and is masochistic if you&#x27;re not careful, but it&#x27;s also <i>incredibly</i> flexible.<p>Conditional compilation in Rust <i>can</i> be done per module, so in theory you can have different archs in different .rs files, each imported conditionally, but that then seems to mean duplication of things like structs, method&#x2F;function signatures in different implementations, which is pretty annoying in many cases (i.e. you&#x27;d just want the inner bits of functions to be different, or optionally call certain subsets for certain archs). You can abstract some of this to &#x27;common&#x27; modules to a limited degree, but not much in my experience, and that comes with additional &#x27;plumbing&#x27; complexity anyway.<p>Rust has cfg attributes, and the cfg_if crate which in theory is a bit closer to the pre-processor functionality (and to a degree allows nesting&#x2F;cascading like in C&#x2F;C++), but in my experience these are just as annoying and limiting but in different ways: it&#x27;s a macro, which is annoying in other ways (needs braces, has some issues with formatting, etc).<p>cfgs also seem to be exclusive, so I&#x27;ve found it incredibly messy getting a balance right between code re-use for common parts (i.e. function&#x2F;method signatures) which need to be shared by multiple cfgs, and duplication.<p>Maybe I&#x27;m missing something?
评论 #29723565 未加载
评论 #29725539 未加载
评论 #29726212 未加载
评论 #29725912 未加载
megumaxover 3 years ago
I would like to see that avr-unknown-gnu-atmega328 works with the latest compiler. Some bug in LLVM broke it[1], because it didn&#x27;t work starting with versions after nightly-2021-01-07[2]. I know that rust team has nothing to do with this, but they should improve the gcc codegen[3] to be able to run rust on more embedded devices than LLVM has support for. Someone wanted to port his libc written in rust to ia64 and the gcc codegen broke and couldn&#x27;t compile that.<p>[1] <a href="https:&#x2F;&#x2F;reviews.llvm.org&#x2F;D114611" rel="nofollow">https:&#x2F;&#x2F;reviews.llvm.org&#x2F;D114611</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;Rahix&#x2F;avr-hal&#x2F;issues&#x2F;124" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Rahix&#x2F;avr-hal&#x2F;issues&#x2F;124</a><p>[3] <a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rustc_codegen_gcc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rustc_codegen_gcc</a>
评论 #29725098 未加载
评论 #29726894 未加载
DoingIsLearningover 3 years ago
It&#x27;s great to see a community forming and the general enthusiasm.<p>But are there any vendors actively participating in or supporting Embedded Rust?<p>For example is any vendor porting drivers to native Rust?
评论 #29723512 未加载
评论 #29723610 未加载
评论 #29726303 未加载
评论 #29727385 未加载
fwiffoover 3 years ago
I haven&#x27;t checked Embedded Rust yet, but it is in my todo list. However, my two main embedded targets for C are Z80 and 8051, and my understanding is that these targets are not supported. I&#x27;d love to have Rust there.
评论 #29728051 未加载
goodpointover 3 years ago
I prefer Nim because it runs on every architecture where a C compiler is available. Also it&#x27;s way more productive.
评论 #29734466 未加载
qqumutover 3 years ago
Nice.