The Toit programming language

Small scripts.
Independent applications.

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.

Scripting

On your computer

Write scripts, process data, and automate everyday tasks. Build command-line applications with Toit’s CLI package.

Start scripting
Embedded

On an ESP32

Work with sensors and peripherals. Run applications in separate containers and update them independently.

Explore embedded development

The language

A short example

Select Toit source filenames from a list and print them in alphabetical order. Short blocks describe what to keep and what to do with each result; it refers to the current element.

Toit has classes, exceptions, and built-in types. You can start with a short script and add structure as it grows.

Read the language guide →
sources.toit
main:
  files := ["test.toit", "README.md", "main.toit"]
  sources := files.filter: it.ends-with ".toit"

  sources.sort.do: print it
$ toit run sources.toit
main.toit
test.toit

Beyond a single program

A runtime for independent applications.

On an embedded device, your application is one part of a running system. Toit containers let you install, stop, and update applications separately.

Keep a sensor application running while you replace another application. Build services that other containers can use.

See how containers fit together →

An open-source project

Use it. Read it. Help shape it.

Toit is developed in the open. Contributions include programs and packages, documentation, bug reports, and changes to the language and runtime.

Meet the project →

Latest language release

Toit v2.0.0-alpha.199

Fix persistent BLE value buffers. Add verbose compiler statistics. Harden subprocess wait and signaling primitives. Merge UART and USB console input. Add terminal control primitives. LSP utilization improvements. Fix asynchronous RSA generation and enable it on ESP32-P4. Reduce ESP32 TLS memory use with dynamic mbedTLS buffers. Add asynchronous I2C/SPI target support. Migrate I2C/SPI controller operations to async. Fix a GC segmentation fault. Fix LSP rename range for nullable type annotations. Deprecate GPIO pins without an explicit direction. Add EC618 platform support.

Read the release notes →