Comments (11)
Can you say a bit more about what requirements you have that require #![no_std]
?
from mio.
If one were to make an stdlib replacement, with IO handled at a deep level by mio, it would be odd to depend on libstd instead of libcore.
from mio.
As of now, I am going to keep the std dependency.
from mio.
Can we revisit this? If we can get mio to work without std (obviously reducing the available feature set) then we can "easily" start implementing threading for microcontrollers through one of the coroutine libraries
from mio.
I'm not familiar w/ the micro controller case. If there is no std
, what will drive Poll
? Could you help me figure out how something like that would work?
from mio.
I'll play around some with mio to understand its internals. I'll come back with an answer once I've done that.
from mio.
This is an old issue, but I would just like to register my interest in seeing this happen. Because there are many lower power ARM cortex micro controllers (for example STM32 platform and others). Which simply do not have enough program memory for STD. So in the embedded world being compatible with no_std
is an important thing. Especially for lower power applications. For example smart watch, IOT devices, remote sensors.
It's a great question to look into. Because most web frameworks require tokio. Which in turn requires Mio. Tokio has a tracking issue for this.
from mio.
@dreamcat4 Mio currently has a shim for unsupported targets, so that takes us a step closer. However one major blocker is io::Error
I believe, is there am alternative for that?
from mio.
We probably could define our own error type as a wrapper around io::Error
. That isn't a big problem IMO.
That said, @dreamcat4 how would you impl non-blocking IO on ARM cortex controllers regardless of mio?
from mio.
A great question...
Uhm forgive my naiivety here, if my general idea / approach is wrong in any way. But I was hoping to go with RTIC, which has been developed for STM32 family of embedded MCUs.
Did a quick search in RTIC docs just now... and here are the places where RTIC already exposes interrupts:
https://rtic.rs/0.5/book/en/internals/interrupt-configuration.html
https://rtic.rs/0.5/api/rtic/index.html?search=interrupt
I myself have not gotten around to play with anything Rust at all just yet. Just researching this general topic whilst trying to get debugging working for STM32 embedded. So... here I am trying to see what the current limitations are. Which places might have some underlying roadblocks. Hopefully that explanation makes some kind of sense to you guys.
As I don't have much time to learn new languages and ecosystems. So if embedded rust is a worthwhile option then it makes the choice of rust overall more compelling (a higher value). More bang-for-my-buck in terms of learning time invested. And reducing the number of new platforms to learn by n=1. Since rust is also great for other types of of development outside of embedded.
In fact embedded applications are like clincher for rust. Because nearly all of the other modern options for (something other than 'C', for getting better memory management)... Others all have much more expensive runtimes. Which then in turn isn't going to shrink down / fit onto the lower end embedded MCUs. And of course because runtime garbage collection usually ends up messing with RTOS guarantees. Which rust doesn't seem to have so many problems with. At least in principle, and also if using no_std
to avoid the std
runtime.
from mio.
@dreamcat4 if you or someone else is willing to write code to support Mio in some form on no_std
platforms I would be ok with it. But currently it doesn't seem useful to turn this is into a no_std
crate without actually supporting an implementation. If someone is starting to work on this feel free to open a new issue or a w.i.p. pr with any questions.
from mio.
Related Issues (20)
- compile time error inside `poll.rs` HOT 3
- poll: Optimize locks and allocations in the critical path
- Poll(2) implementation follow-ups
- Official ESP-IDF framework support HOT 3
- Make `CompletionPort` public? HOT 7
- No data coming from Poll HOT 8
- Difference behaves between Linux and Windows HOT 2
- How to wait for a socket to be writable? udp / Interest::READABLE | Interest::WRITABLE HOT 6
- could not compile mio due to 44 previous errors HOT 3
- WakerRegistrar mentioned in comment is not present HOT 2
- Decide MSRV for v1 HOT 2
- Use rustix instead of libc HOT 2
- Document MSRV policy HOT 1
- Update socket types API to match std lib HOT 4
- unresolved imports in target xtensa-esp32-espidf HOT 3
- `syscall!` macros hide unsafe code HOT 2
- why is it possible to create a mio TcpStream from std TcpStream but going the other way around is unsafe? HOT 13
- peek blocks after read on windows HOT 7
- Poll changing interest of server socket on Windows HOT 1
- Cannot continue listen! HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mio.