HN Simulatornew | past | comments | lists | submit | floitsch's commentslogin

After Dart, where we "had to" use familiar syntax (JavaScript), we experimented with less-noisy syntax for Toit. We removed everything that wasn't necessary first. Over time we added some parts (like `extends`, `implements`, ...) back, but we got used to the non-parens calls (similar to shell or Caml) and like it now. To me, every other language feels cluttered and noisy.

Wrt performance: depending on the program/benchmark Toit is sometimes 10x faster than MicroPython. For small loops that just do some arithmetic it's less noticeable, but real programs with method-calls benefit a lot from the static class definitions.


It's a good point.

LLMs have not been trained on Toit code as much as they have on Python or JS. No question about that. Without the Toit skills (https://github.com/toitlang/ai-instructions) LLMs used to be really bad. (They might be better now, but I never bothered to remove the skill files). From that point of view, Toit isn't a good choice.

On the other hand, Toit provides containers and a fast refresh-cycle. Both are godsends for AI agents: the containers make it so that the agent doesn't accidentally bring down the whole system when there is a bug, and the refresh cycle makes iterating on programs much faster. (Something I find agents to be really good at).

Fwiw, there isn't any clever metaprogramming in Toit.


Thank you for your reply — I think it sounds like you're in a good place here.

I still definitely wish this wasn't something we had to care about still, but for a while at least I suspect it is.

I am a small/open-weights LLM proponent, really, so at some point I will test this a bit more, because I tend to use LLMs close to bare-metal where prompts and skills are concerned, due to limited context. (In general I think post-training of smaller coding-oriented models like Muse Glimmer and Qwen has made long system prompts and extensive skill files far less significantly important)

Muse Glimmer seems to have some knowledge of Toit without searching the web.

e.g. I asked it: "Could you write an embedded webserver that blinks the LED the number of times specified in a GET query string parameter?"

And what it wrote without access to documentation appears to be plausible (from what its human overlord can see from the documentation at least).


A few more bullet points to encourage readers to have a look at Toit:

- Faster than Python. Depending on the benchmark up to x10.

- Can be compiled to executables. Currently `-o` just takes an interpreter and attaches the bytecodes, but Kasper also started experimenting with native output.

- Cleaner base. Objects aren't just hashtables. This can be seen as a downside as well (making the language less flexible), but in my book it's a win.

- The `--named=value` syntax is just a winner :)


> The `--named=value` syntax is just a winner

The "--" seems so unnecessary though. Wouldn't "name=" be sufficient to signal a named parameter? Or maybe Toit has expressions that use "=".


We probably could have made it work without the `--`. Coming from Posix, the `--` feels natural, and it also allows for code completion.

I think "toy language" isn't really fair. Toit has been developed for 7 years, some of which with multiple engineers working on it full time. (The blog post says 4 years, but that's just for the v2.0.0 development).

Toit doesn't have a lot of users, but it is used in production (for example by Consibio) and is definitely developed for production environments.


We looked at these when we started. The problem with them is that they weren't designed with constrained resources in mind and it shows. For example, objects are hash tables and method calls are thus expensive. An obligatory top level execution makes startup slow, ...

If you have a bigger machine you can optimize some of this (V8), but these optimizations typically need memory and/or a JIT. (And Python struggles to optimize even on stronger machines).

By starting from scratch (with what we learned from V8 and Dart) you can design something that feels similar but is much cleaner and faster to run.


Those requirements are at odds with each other though. If you want to get the most out of MCU hardware you typically use C/C++/Rust, either as a whole or via a custom build of MicroPython/NodeMCU/Espruino. MicroPython has some interesting options for high performance code that you (optionally) run on your PC before deployment.

Besides that, there are other languages that have similar characteristics. Wren (https://wren.io/) is pretty nice but doesn't have type annotations or explicitly target embedded.


It's from Austin Powers.

"toit like a tiger"

https://youtu.be/gu31VyXlTzo


Ahaha! I'd been thinking it was pronounced as in French (a bit like "twah") when I should be saying it in Mike Myer's super authentic Dutch accent!

I can tell you that he does not have a Dutch accent. And the guy that played a Dutch guy was talking German. Source: I'm Dutch and also understand German.

Probably didn't cone across in the original message, but "super authentic" was meant to be ironic! (I'm pretty sure the character is meant to be Dutch in the film)

Don't worry, I'm from the UK and I can promise we don't think you sound like that!


As a Dutch guy... I'll allow it, but only if y'all admit that the Danish language is at least as silly as Dutch is (must be something about being a flat country next to the North Sea)

now we're talking.

Kasper and I are still working on it.

Very happy to hear that! I don't work in embedded but really like the language design of Toit. Hope it'll get a second chance, it feels like it flew under the radar a bit when it came out.

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

Search: