Jump to content

Draft:Toit

From Wikipedia, the free encyclopedia

Toit
ParadigmMulti-paradigm
DevelopersLars Bak, Erik Corry, Anders Johnsen, Florian Loitsch, Kasper Lund
First appeared2018[1]
Stable release
v2.0.0-alpha.189[2] / October 28, 2025; 56 days ago (2025-10-28)
Typing disciplineOptional. (Added types are checked and used for optimizations.)
Memory managementGarbage collected
Platformx86-64, Esp32
OSPosix, Windows, FreeRTOS
LicenseLGPL
Filename extensions.toit
Websitehttps://www.toitlang.org/
Influenced by
Java, Dart, Smalltalk, Python, Shell

Toit

[edit]

Toit[3] is an open-source[4], free[5], high-level, object-oriented programming language designed initially for ESP32 microcontrollers and Internet of Things (IoT) devices.[6]

Design and Goals

[edit]

The language was created to address limitations in existing high-level languages[7] (e.g., Python, JavaScript) when used on resource-constrained embedded hardware. According to its creators, Toit code executes over 30 times faster[8] on the Espressif ESP32 microcontroller, than MicroPython while still offering high-level abstractions and a memory-safe runtime.

Toit aims to provide a modern, Python-like developer experience[9] while making it practical to run code on microcontrollers. It's developers intended to combine convenience, performance, and safety.

History

[edit]

Founding

[edit]

Toitware was founded in 2017 as "Toitware ApS", with the purpose of building a new programming language focused on IoT development[10]. In 2019, the company secured DKK 23M ($3.5M) in seed capital, provided by Swedish venture capital company Creandum.[11] Initial versions were strongly cloud oriented, and required cloud registration to get started.[12]

Open Sourcing

[edit]

In November 2021, Toitware ApS announced it would open source Toit to foster a larger community and accelerate its development.[13][14]The open-sourcing of Toit coincided with the first alpha release of v2.

The cloud offering from Toitware ApS was ultimately discontinued, and development focus shifted toward a Supabase-based PostgreSQL fleet-management solution called "Artemis". Users run their own instances on the platform, with Artemis' code also being open-sourced.[15]

In 2024, Toitware ApS ceased operating.[16] As of 2025 the project source is being maintained by two of the original Toitware ApS employees, continuing to drive community and development.

Naming

[edit]

Toit was named after the catchphrase of the character ‘Johann van der Smut’ in the movie Goldmember. In a comedic Dutch accent, the character repeatedly uses the expression "Toit like a tiger". This can be seen in the Toit logo, which was stylised after the feline nose.

Key Features

[edit]

The Toit language has the following characteristics:

  • High-level, object-oriented, memory-safe: Toit supports classes, methods and garbage-collected memory management.[17]
  • Declarative, and partially statically analyzable: Programs can be analyzed to catch errors prior to being run. If types (optional) are used, static analysis quality improves.
  • Low noise indentation-based syntax: Similar to Python, Toit uses indentation for grouping. Common operations therefore use minimal symbols: characters are not required to indicate the end of statements (common to some languages, eg, the use of semicolons in Java). Symbols, such as parentheses, are not used for calls or if blocks (common to many languages, such as C++ and Rust).
  • Standard libraries, support for control flow, collections, exceptions, etc.: Toit includes support for strings, lists, maps, classes, exception handling, and other standard programming language features.
  • Support for microcontroller I/O and embedded peripherals: In the context of IoT/embedded usage, Toit provides access to GPIO, I2C, SPI and other hardware interfaces.[18][19]
  • Live reloading and rapid development workflow: Toit includes capabilities for deploying and iterating code on devices in-situ.[20][21]

Syntax and Examples

[edit]

Hello World

[edit]

A minimal ‘Hello World’ program in Toit:

main:
  print "Hello, World!"

Functions, Methods & Parameters

[edit]

Functions are declared by writing the name, followed by its parameters and a colon:

print-hello name:      // A function 'print-hello' with parameter 'name'.
  print "hello $name"  // Prints 'hello ' followed by the supplied name.

Calls use juxtaposition, like the shell, Caml or Smalltalk. Parameters follow the function name without parentheses or commas.

main:                   // Definition of the 'main' function.
  print-hello "Austin"  // Calls ‘print-hello’ with one argument.

Classes

[edit]

Toit has classes, interfaces and mixins. Classes are declared with class. Constructors, fields, and methods are supported, as are inheritance, etc.

class Foo:
  some-method:
    print "in some-method"

class Bar extends Foo:
  constructor:
    print "in constructor"

  bar-method with params:
    print "in bar-method"

Implementation and Runtime

[edit]

Toit programs are compiled to bytecode and executed by a purpose built, lightweight Virtual Machine (VM). The same VM is used when working on microcontrollers and on the desktop. On the desktop, Toit can also bundle the VM and the bytecode together, resulting in a self-contained executable.[22]

Containers

[edit]

On the ESP32, the Toit VM handles multiple programs at the same time. These are referred to as "containers"[23] and run independently from each other. They don't share any memory and run in parallel. Containers can communicate with each other by using a built-in RPC mechanism.

Concurrency

[edit]

Inside a container, programs do not run in parallel. Instead, Toit provides "tasks" - cooperative threads. Tasks can only be interrupted at specific locations: at yield statements, or in places where the task waits for the system or the hardware.

Ecosystem and Tooling

[edit]

There are two ways to use Toit:

  • For desktop systems: Toit installations use an executable called toit which can compile and run code, manage packages, etc.
  • For embedded systems: A tool named 'Jaguar' (jag) enables developers to deploy, update, and manage Toit applications on embedded hardware.

Both tools are hosted and available publicly on GitHub[24] and form part of the completed system download/install.

Position in embedded / IoT space

[edit]

Toit is part of a broader trend of languages and runtimes designed to make embedded development safer, more productive, and more accessible without sacrificing too much in terms of performance. As noted by one commentator: compared to writing in C/C++ (the traditional choice for embedded systems[25]) languages like Toit are intended to reduce complexity and improve development velocity, while still being efficient enough for many IoT use-cases.[9][18]

At the same time, using a high-level managed runtime on resource-constrained hardware is a trade-off: while high level languages (such as Toit, and others) offer convenience and safety, performance comparisons may vary compared to highly optimized C/C++ code.

As of 2025, support is focused on ESP32-class microcontrollers.

References

[edit]
  1. ^ Flaherty, Nick (Nov 26, 2021). "Toit opens up its IoT programming language". www.eenewseurope.com.
  2. ^ "Release v2.0.0-alpha.189". Oct 28, 2025 – via GitHub.
  3. ^ "Toit documentation". docs.toit.io.
  4. ^ "toitlang/toit". Dec 16, 2025 – via GitHub.
  5. ^ "Open-source and free - Toit". toit.io.
  6. ^ Higginbotham, Stacey (Aug 24, 2021). "Toit wants to be a platform for constrained networked devices". staceyoniot.com.
  7. ^ Jagdale, Saumitra (Aug 20, 2021). "Resolving the Complexities in IoT Development with the Support of APIs and High-Level Languages". www.eetimes.com.
  8. ^ Aufranc (CNXSoft), Jean-Luc (Nov 28, 2021). "Toit open-source language claims to be 30x faster than MicroPython on ESP32 - CNX Software". cnx-software.com.
  9. ^ a b Peck, Mariano Martinez (Sep 23, 2021). "Bridging the Gap with Toit — A Rich Dev Experience for Microcontrollers". instantiations.com.
  10. ^ Andersen, Tania (Jul 3, 2018). "Aarhus experts from Chrome's Javascript engine create IoT language and virtual machine". www.version2.dk (in Danish).
  11. ^ "Toitware secured seed capital in an investment round including Creandum". nordic9.com. Feb 25, 2019.
  12. ^ "Product of the Week: Toit Software Platform". embeddedcomputing.com. Sep 7, 2021.
  13. ^ Lund, Kasper (Nov 22, 2021). "The Toit Language is now Open Source". medium.com.
  14. ^ Flaherty, Nick (Nov 26, 2021). "Toit opens up its IoT programming language". www.eenewseurope.com.
  15. ^ "toitware/artemis". Dec 16, 2025 – via GitHub.
  16. ^ "CVR 38984594 on Denmark's Central Business Register". datacvr.virk.dk.
  17. ^ "First device driver in Toit". www.ekorau.com. May 28, 2021.
  18. ^ a b Lüdiger, Florian (Aug 29, 2022). "Toit will bring your IoT projects up to speed". codecentric AG.
  19. ^ Andersen, Morten. "Toit Tech Notes". tech-notes.accel.dk.
  20. ^ Sinha, Akshayan; Agarwal, Akarsh (Dec 17, 2022). "Toit. io | IoT Platform Series #2". Hackster.io.
  21. ^ Jagdale, Saumitra (Aug 6, 2021). "Microsoft Azure, IoT, Balena, Particle and Toit IoT Development platform comparision". cnx-software.com.
  22. ^ Lund, Kasper (Jul 14, 2021). "Why doesn't V8 fit on my microcontroller?".
  23. ^ Gunter (Dec 29, 2021). "Toit: Containers on Microcontrollers". medium.com.
  24. ^ "Toit language". GitHub.
  25. ^ King, Nicola (Sep 21, 2023). "Blog - Is Embedded C++ the Future of Embedded Systems Development?". Redline Group.