DNS blackhole the domain and run.
> According to Denmark's Central Business Register, Toitware ApS ceased operating in 2024.[9] Development of the language continues as a community project on GitHub.
Seems unlikely to be a bait and switch at this point
Nice syntax. It looks like how we'd design programming if C had never existed.
add a/int b/int -> int:
return a + b
main:
print (add 2 3) // Prints 5. 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.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.
[1]: https://github.com/wasm-micro-runtime/wasm-micro-runtime
Because if not, that might explain the lack of marketing around it.
Aside: funny how Dart and TS both have Danish creators.
https://en.wikipedia.org/wiki/Anders_Hejlsberg
https://en.wikipedia.org/wiki/Lars_Bak_(computer_programmer)
Jetpack Compose was created by Android team exactly as counter reaction to Flutter.
Go got lucky with their internal advocacy, and the push to rewrite Kubernetes from Java into Go.
Google isn't exactly known for great programming language design, contrary to runtime implementations.
Also why after namespaces and enums, the team never introduced any other feature that wasn't also part of JavaScript standardisation process, and has since then discouraged their use.
A fundamental choice you have to make with a new programming language is how compatible you want it to be with existing languages and their ecosystems. Hewing closely to another language allows you to reuse and build on top of all of the code already written in that language. But it also means that you can be forced to recapitulate features from that language that aren't great. Building a new language and ecosystem from scratch lets you make a clean break from those but at the very large expense of having to build a universe from scratch.
TypeScript took the former approach. All of the world's existing JavaScript code is TypeScript too. You can freely interoperate between TypeScript and JavaScript, keep using your existing JavaScript libraries, and incrementally migrate your JS codebase to TS one file at a time.
At the same time, TypeScript inherits much of the dumb stuff about JavaScript. No real integer type, funny scoping semantics (though strict mode mostly addresses this), extreme dynamism that is hard to fit into static types. The latter is particularly important. TypeScript's type system is deliberately not sound in order to be able to mostly statically type JavaScript while allowing many of the weird and complex design patterns from that language. That in turn means that even fully typed TypeScript programs don't get the fully performance benefits of static types. That's the main reason that the TypeScript compiler itself is no longer written in TypeScript: JS is simply too slow because of dynamic typing.
Dart took a much larger step away from JavaScript. It has its own object model and runtime semantics. With Dart 2.0, it has a fully sound static type system and in 2.12 we shipped sound handling of null. Because these static semantics are fully sound, the compiler can take advantage of types to generate smaller, faster code. Performance is complex, but Dart's runtime performance is in the same bucket as Java and C#, which is about as good as a GC language can get.
The cost is that migrating an existing web application to Dart is pretty much a rewrite. It was really hard for us to get any real traction until Flutter came out. With Flutter, users are already accepting that they are writing a new app for that framework, so the hop to a new language was more manageable.
I don't know how AI affects this calculus. AI can make it much faster to automatically migrate a program from one language to another. But I think it also makes human users more conservative about which language they use. Since they aren't writing as much of the code anyway, they may have less incentive to care about using a "better" language.
I agree completely that Hejlsberg is a star and very tough to compete with. I've always thought of programming languages more as offering different ways to solve problems and less about one trying to win at the expense of another. I don't want Dart to beat TypeScript, I just want Dart to be the best it can be for what it is.
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.https://docs.toit.io/language/beginner/lists-and-functions/#...
The name argument is positional here.
Then again, nowadays, it’s not like you have to write code yourself.
How about performance compared to compiled MicroPython (viper)?
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.
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.
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.
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).
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..]
Most importantly though (/s), is this toit as in "roof" in French, toit as in "to it", or otherwise?
"toit like a tiger"
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.
- 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 "--" seems so unnecessary though. Wouldn't "name=" be sufficient to signal a named parameter? Or maybe Toit has expressions that use "=".