​

Learn Toit

Toit is an object-oriented, garbage-collected language for scripting on your computer and programming connected devices. You can use the same language for a command-line tool, a network service, or an application on a microcontroller.

Choose your starting point

Your experienceStart hereWhat you will learn
Already comfortable programmingToit for programmersA complete language tour, with comparisons to C/C++, JavaScript, Python, and Java/Kotlin.
New to programmingBeginner lessonsBuild a temperature report step by step, then add lists, functions, and objects.

The programmer's tour explains Toit directly; you do not need to know every language used for comparison. Familiar features are covered briefly, while Toit-specific concepts receive more explanation and examples.

The C/C++ introduction covers the language from a native programmer's starting point. The JavaScript and Python guides focus on differences from those languages. Use the comparison cheat sheet for side-by-side syntax lookup.

Look up a language feature

The language reference is organized by topic. It assumes you can already read a small Toit program; it is not a sequence of lessons. Use it for syntax rules, edge cases, and more detailed examples.

Find a topic

The topics from the earlier language introduction are now covered in the lessons and programmer's tour. These links also keep its section bookmarks useful.

TopicContinue reading
Your first programRead the explanation
FunctionsRead the explanation
String interpolationRead the explanation
Function argumentsRead the explanation
Creating objectsRead the explanation
Fields and methodsRead the explanation
Reporting a list of valuesRead the explanation
Comments and indentationRead the explanation
List iterationRead the explanation
Named argumentsRead the explanation
Conditions and expressionsRead the explanation
LoopsRead the explanation
Maps and setsRead the explanation
Blocks and lambdasRead the explanation
Block parametersRead the explanation
Block and lambda resultsRead the explanation

Use Toit in a project

For a host script or command-line tool, save your program in a .toit file and run it with toit run. Use the package quick start to add dependencies.

For an ESP32 application, run on your device. The hardware and networking tutorials list their additional setup requirements.