!zbjndUiYJDvhDRkPGw:matrix.org

rp-rs

126 Members
Rust on the Raspberry Pi Microcontrollers/Pico https://github.com/rp-rs 18 Servers

Load older messages


SenderMessageTime
23 Oct 2021
@dirbaio:matrix.orgdirbaio does alloc still require nightly? :C 00:54:13
@dirbaio:matrix.orgdirbaio yep, for #![feature(alloc_error_handler)] 00:54:42
@dirbaio:matrix.orgdirbaionostd_async doesn't require alloc, huh00:59:46
@dirbaio:matrix.orgdirbaio * nostd_async doesn't require alloc, huh00:59:49
@ithinuel:matrix.orgithinuelSo, overall, anyway, the embassy support is gated behind a feature. novice users won't dig that far and won't have the trouble of switching to nightly. More advanced users requiring async are likely already running on nightly so that probably won't be an issue there either. Trying to build the example will trigger the error saying it requires the feature and enabling that feature on stable will trigger the error that certain features are only available on nightly. This should be enough to deter inexperienced users 😀 00:59:50
@dirbaio:matrix.orgdirbaiowhich makes it unsound. use-after-free if you wake a task after dropping it01:00:44
@dirbaio:matrix.orgdirbaiowakers are Send+Sync+'static so they can live forever01:11:04
@dirbaio:matrix.orgdirbaioso either you require tasks to be 'static (what embassy does)01:11:17
@dirbaio:matrix.orgdirbaio but to put a future in a static you need either type_alias_impl_trait, or ultra horrible unsafe hacks 01:12:21
@dirbaio:matrix.orgdirbaioor you refcount the tasks, like an Arc, where each Waker and JoinHandle counts as a reference (what tokio, async-std, smol etc do)01:12:31
@dirbaio:matrix.orgdirbaiobut that needs alloc01:12:42
@dirbaio:matrix.orgdirbaio there is NO sane way to make an executor without either alloc or type_alias_impl_trait 01:13:23
@dirbaio:matrix.orgdirbaioand both are nightly-only01:13:29
@dirbaio:matrix.orgdirbaioso... 🤷01:13:37
@dirbaio:matrix.orgdirbaionot exactly01:16:40
@dirbaio:matrix.orgdirbaio you can make an "executor" like loop { fut.poll() } on stable 01:16:49
@dirbaio:matrix.orgdirbaioif you want to run just 1 future, no multtasking01:16:57
@dirbaio:matrix.orgdirbaio * if you want to run just 1 future, no multtasking01:17:05
@ithinuel:matrix.orgithinuel

can't you just

loop {
  fut1.poll();
  fut2.poll();
}

? 😀

01:18:05
@ithinuel:matrix.orgithinuel *

can't you just

loop {
   fut1.poll();
   fut2.poll();
}
``` ?
01:18:09
@ithinuel:matrix.orgithinuel *

can't you just

loop {
   fut1.poll();
   fut2.poll();
}

?

01:18:15
@ithinuel:matrix.orgithinuel *

can't you just

loop {
  fut1.poll();
  fut2.poll();
}

?

01:18:25
@ithinuel:matrix.orgithinuel *

can't you just

loop {
  fut1.poll();
  fut2.poll();
}

? 😀

01:18:37
@dirbaio:matrix.orgdirbaiohehehe01:18:54
@dirbaio:matrix.orgdirbaio that's like polling join(fut1, fut2) 01:19:11
@dirbaio:matrix.orgdirbaioso yeah you could glue all your app together in a single giant Future and then poll-loop that01:19:47
@dirbaio:matrix.orgdirbaio * so yeah you could glue all your app together in a single giant Future and then poll-loop that01:19:48
@dirbaio:matrix.orgdirbaio
In reply to @dirbaio:matrix.org
there is NO sane way to make an executor without either alloc or type_alias_impl_trait
by "executor" there I mean a "real" executor that tracks which tasks have been woken and only polls these
01:21:03
@dirbaio:matrix.orgdirbaioand puts the core to sleep if no tasks want to run01:21:46
@devsnek:matrix.orgdevsnekyou don't need alloc if you manually keep track of entries in a huge statically allocated slice04:45:26

There are no newer messages yet.


Back to Room List