Nim in Action

Learn Nim from one of the main developers of the language.

Practical examples

Learn by implementing useful software projects. Including CLI chat applications, web apps, parsers and much more!

Fun and powerful language

Nim is a new systems programming language that gives you the low-level power of C with the elegance and ease of languages like Python and Ruby. It is perfect for developers that wish to explore systems programming.

Universal concepts

The book includes best practices and concepts that apply to almost all programming languages. So you will be able to use what you learn for software projects in other languages as well.

Compatible with Nim v1.0

This book has been written with Nim 1.0 in mind, going as far as including all of the examples in the book inside Nim's test suite to ensure they do not break. With the release of Nim 1.0, this compatibility still holds true.

Learn more about Nim

A goldmine for Nim programmers; great insights for any general programmer.

Cosimo Attanasi, ER Sistemi

Gives readers a solid foundation in Nim, a robust and flexible language suitable for a variety of projects.

Robert Walsh, Excalibur Solutions

A great resource for an incredibly powerful language.

Jonathan Rioux, TD Insurance

What's inside?

Supports v1.0

Chapter 1

Explains what Nim is, compares it to other programming languages, and discusses its strengths and weaknesses.

Download

Chapter 2

Teaches the basics, such as the syntax and fundamental features of the language. This includes a demonstration of procedure definitions and exception handling.

Chapter 3

This is where you’ll develop your first nontrivial Nim application. The primary purpose of this application is communication: it allows messages to be sent through a network. You’ll learn, among other things, how to create command- line interfaces, parse JSON, and transfer data over a network in Nim.

Chapter 4

Gives an overview of the standard library, particularly the parts of it that aren’t covered in other chapters but are useful.

Chapter 5

Discusses package management in Nim and teaches you how to create your own packages and make them available to others.

Chapter 6

Explains what parallelism is and how it can be applied to different programming tasks. You’ll see a parsing example, demonstrating different ways to parse data in Nim and how parsing can be parallelized.

Chapter 7

This is where you’ll develop your second nontrivial Nim application: a web application based on Twitter. You’ll learn how to store data in a SQL database and generate HTML.

Chapter 8

Looks at the foreign function interface and shows how it can be used to make use of C and JavaScript libraries. You’ll develop a simple application that draws the letter N on the screen, first using a C library and then using JavaScript’s Canvas API.

Download

Chapter 9

Explains what metaprogramming is, discussing features such as generics, templates, and macros. At the end of this chapter, you’ll use macros to create a domain-specific language.

Buy Nim in Action

Purchase via Manning

Info about buying here:

  • You can purchase an eBook here.
  • If purchasing a printed book you will get an eBook for free immediately.
Buy now

Purchase via Amazon

Info about buying here:

  • Free shipping if using Prime.
  • You can't buy an eBook here. But you will get one for free after you receive the printed book.
  • Sometimes cheaper than buying directly from Manning.

Bonus resources

Source code

The source code for all the guided projects in the book is available on GitHub.

Explore

Documenting, profiling and debugging Nim code

This is a guide that was initially meant to be part of the book. It shows you how to document, profile and debug Nim code using various tools.

Read

Enhancing the Nim IRC bot with !eval

A video where I am coding in Nim live. I implement a !eval command in the Nim IRC bot and explain how I do it.

Watch

Nim in Action: Book errata for Nim v1.0.0

Check out this handy errata compiled by a member of our community showing Nim in Action's errata for Nim v1.0.0.

Read