Git Product home page Git Product logo

Comments (11)

wycats avatar wycats commented on May 17, 2024

Can you say a bit more about what requirements you have that require #![no_std]?

from mio.

cgaebel avatar cgaebel commented on May 17, 2024

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.

carllerche avatar carllerche commented on May 17, 2024

As of now, I am going to keep the std dependency.

from mio.

oli-obk avatar oli-obk commented on May 17, 2024

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.

carllerche avatar carllerche commented on May 17, 2024

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.

oli-obk avatar oli-obk commented on May 17, 2024

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.

dreamcat4 avatar dreamcat4 commented on May 17, 2024

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.

Thomasdezeeuw avatar Thomasdezeeuw commented on May 17, 2024

@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.

carllerche avatar carllerche commented on May 17, 2024

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.

dreamcat4 avatar dreamcat4 commented on May 17, 2024

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.

Thomasdezeeuw avatar Thomasdezeeuw commented on May 17, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.