Chapter 2. Getting started

This chapter covers

  • Understanding Nim basics
  • Mastering control flow
  • Using collection types
  • Handling exceptions
  • Defining data types

In this chapter, you’ll learn about Nim’s syntax, procedures, for loops, and other basic aspects of the language. Throughout this chapter, we’ll cover a lot of information to give you a broad taste of the language.

Before you begin, make sure you have Nim installed and that it works on your computer. You’ll also need a text editor to edit Nim code. Take a look at appendix B for instructions on how to install Nim and other related tools.

2.1. Nim syntax

The syntax of a programming language is a set of rules that govern the way programs are written in that language. You’ve already ...

Get Nim in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.