I rather like WebAssembly for this use-case. You don't necessarily need a new language, you need a Wasm runtime targeted at embedded devices, like WAMR [1], which even has a AOT compiled mode.
Toit is a language for writing scripts on your computer and applications on your ESP32. A readable syntax, an efficient runtime, and tools that work together.
Free and open source. Maintained by volunteers.
This seems very interesting. It almost looks/feels like Pythonic Go.
There's already another syntax example in the thread, but I want to point out the weirdest syntax I've seen yet: positional arguments look like posix command arguments:
greet name/string="World" --greeting/string="Hello" -> string:
return "$greeting $name"
main:
print (greet) // Prints Hello World.
print (greet "Ada" --greeting="Hi") // Prints Hi Ada.
Even I (as a sort of grudging cynic) now find myself thinking in these terms:
Is this a language that an LLM can write well?
Especially a small LLM, given the scripting and friendly IoT focus, where it might be useful for a smaller model in a home assistant to be able to write in it.
A packageable scripting language with fewer footguns that has LLM-friendly features feels like it probably has a place in the world.
But my own experience so far suggests that smaller LLMs in particular do better with simpler languages with obvious flow of control and less cleverness like metaprogramming.
I have used toit in a lot of my projects. It is a really nice language and so much cleaner than all the alternatives I have tried (Arduino, Python, Lua).
The tools just work and I got used to the language really quickly.
I did hate that it was bytecode. It just felt wrong to run bytecode on an ESP32. OTOH it just works, and I have never noticed any performance problems.
My latest project is a controller for a slave-clock: https://gitlab.com/close2/nebenuhr-toit
(There is also a Garmin repository that allows me to control the clock using my Garmin watch.)
Full disclosure: I had to use toit (floitsch is my brother), but it really is a nice language and development environment.
Is there some kind of an advertising blurb for why you’d want to use Toit, especially for scripting? I think the only thing I saw was “a readable language”, but I’d probably consider Python more readable than it judging from the examples.
16 comments:
The wikipedia page https://en.wikipedia.org/wiki/Toit is short but still gives a lot of context.
I rather like WebAssembly for this use-case. You don't necessarily need a new language, you need a Wasm runtime targeted at embedded devices, like WAMR [1], which even has a AOT compiled mode.
[1]: https://github.com/wasm-micro-runtime/wasm-micro-runtime
Here's a beginner tutorial for the language: https://docs.toit.io/language/toitversus
Nice syntax. It looks like how we'd design programming if C had never existed.
The people behind Toit are the original people behind the V8 VM in Chrome. They know their stuff.
This seems very interesting. It almost looks/feels like Pythonic Go.
There's already another syntax example in the thread, but I want to point out the weirdest syntax I've seen yet: positional arguments look like posix command arguments:
How did you came up with this strange syntax? Why not use a Python like one which is already known?
How about performance compared to compiled MicroPython (viper)?
Even I (as a sort of grudging cynic) now find myself thinking in these terms:
Is this a language that an LLM can write well?
Especially a small LLM, given the scripting and friendly IoT focus, where it might be useful for a smaller model in a home assistant to be able to write in it.
A packageable scripting language with fewer footguns that has LLM-friendly features feels like it probably has a place in the world.
But my own experience so far suggests that smaller LLMs in particular do better with simpler languages with obvious flow of control and less cleverness like metaprogramming.
I wish any product new release announcement include a brief introduction about the product itself...
I have used toit in a lot of my projects. It is a really nice language and so much cleaner than all the alternatives I have tried (Arduino, Python, Lua).
The tools just work and I got used to the language really quickly.
I did hate that it was bytecode. It just felt wrong to run bytecode on an ESP32. OTOH it just works, and I have never noticed any performance problems.
My latest project is a controller for a slave-clock: https://gitlab.com/close2/nebenuhr-toit (There is also a Garmin repository that allows me to control the clock using my Garmin watch.)
Full disclosure: I had to use toit (floitsch is my brother), but it really is a nice language and development environment.
[Edit: typos..]
Looks interesting! I can't tell really from the docs the untended use case though. It says "scripts", but also " applications".
Most importantly though (/s), is this toit as in "roof" in French, toit as in "to it", or otherwise?
Looks quite nice
Who is using this? The company originally behind it has shut down
Oh, good—I've been looking for a Round one for years.
Is there some kind of an advertising blurb for why you’d want to use Toit, especially for scripting? I think the only thing I saw was “a readable language”, but I’d probably consider Python more readable than it judging from the examples.
The last thing this planet needs a new programming language