4 ms·
It’s strange that in their examples they don’t show any I/O (apart from print). I would expect support from such a language to support me with I/O while I conc
by lixtra 4y ago
It’s strange that in their examples they don’t show any I/O (apart from print).
I would expect support from such a language to support me with I/O while I concentrate on my program. For example by providing an event loop.
Of course, if I need a more performant approach I would switch to a low level language.
- scotty79 4y agoThe documentation at first glance looks like any general purpose language but they do have io through various buses: https://docs.toit.io/peripherals https://docs.toit.io/peripherals They also have nice simple tutorials. Not sure about the event loop. I don't think it's even based. Looks more like "immediate mode".
- the__alchemist 4y agoI concur that's strange; the homepage code examples are standard imperative things. Clean IO, peripheral APIs, scheduling/code structure, and resource sharing is what I'd expect as priorities from an embedded-dedicated lang.
- scotty79 4y agoI think they mostly try to introduce the new language itself. But surely quick "How to do Esp32 things" mirroring this http://docs.micropython.org/en/latest/esp32/quickref.html http://docs.micropython.org/en/latest/esp32/quickref.html would be very nice. Without it you need to look for tutorials and documentation tree or even documentation for specific packages providing embedded functionalities.
- floitsch 4y agoIt's on our (my) Todo list. The next best thing is currently probably this tutorial: https://docs.google.com/document/d/1K-TYea7jbYfj2ecMUmr0T0zd4JDpk5lo0mJNOLPUrhc/edit?usp=drivesdk https://docs.google.com/document/d/1K-TYea7jbYfj2ecMUmr0T0zd...
- ErikCorry 4y agoThere is no event loop. You make lightweight threads called tasks, and they can block on things or wait for each other. https://docs.toit.io/language/tasks https://docs.toit.io/language/tasks Synchronization: https://libs.toit.io/monitor/library-summary https://libs.toit.io/monitor/library-summary For example the GPIO pin has a wait_for method which pauses a task until a signal is seen. https://libs.toit.io/gpio/class-Pin https://libs.toit.io/gpio/class-Pin