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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.