Hacker News new | past | comments | ask | show | jobs | submit login

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.




There 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

Synchronization: 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


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


I 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 would be very nice.

Without it you need to look for tutorials and documentation tree or even documentation for specific packages providing embedded functionalities.


It's on our (my) Todo list.

The next best thing is currently probably this tutorial: https://docs.google.com/document/d/1K-TYea7jbYfj2ecMUmr0T0zd...


The documentation at first glance looks like any general purpose language but they do have io through various buses:

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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: