Efficient, expressive, elegant

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula.


  • Nim generates native dependency-free executables, not dependent on a virtual machine, which are small and allow easy redistribution.
  • The Nim compiler and the generated executables support all major platforms like Windows, Linux, BSD and macOS.
  • Fast deferred reference counting memory management that supports real-time systems.
  • Modern concepts like zero-overhead iterators and compile-time evaluation of user-defined functions, in combination with the preference of value-based datatypes allocated on the stack, lead to extremely performant code.
  • Support for various backends: it compiles to C, C++ or JavaScript so that Nim can be used for all backend and frontend needs.


  • Nim is self-contained: the compiler and the standard library are implemented in Nim.
  • Nim has a powerful macro system which allows direct manipulation of the AST, offering nearly unlimited opportunities.


  • Macros cannot change Nim's syntax because there is no need for it — the syntax is flexible enough.
  • Modern type system with local type inference, tuples, generics and sum types.
  • Statements are grouped by indentation but can span multiple lines.
import strformat

  Person = object
    name: string
    age: Natural # Ensures the age is positive

let people = [
  Person(name: "John", age: 45),
  Person(name: "Kate", age: 30)

for person in people:
  # Type-safe string interpolation,
  # evaluated at compile time.
  echo(fmt"{person.name} is {person.age} years old")
# Thanks to Nim's 'iterator' and 'yield' constructs,
# iterators are as easy to write as ordinary
# functions. They are compiled to inline loops.
iterator oddNumbers[Idx, T](a: array[Idx, T]): T =
  for x in a:
    if x mod 2 == 1:
      yield x

for odd in oddNumbers([3, 6, 9, 12, 15, 18]):
  echo odd
# Use Nim's macro system to transform a dense
# data-centric description of x86 instructions
# into lookup tables that are used by
# assemblers and JITs.
import macros, strutils

macro toLookupTable(data: static[string]): untyped =
  result = newTree(nnkBracket)
  for w in data.split(';'):
    result.add newLit(w)

  data = "mov;btc;cli;xor"
  opcodes = toLookupTable(data)

for o in opcodes:
  echo o

Recent articles

Nim Community Survey 2019 Results

Nim community survey 2019 has been open for 50 days, and we have received 908 responses, which is our record-high number (771 in 2018, 603 in 2017). Before we go into details, we would like to thank all the people who took the time to respond. We really appreciate the feedback!

Version 1.0.6 released

The Nim team is happy to announce version 1.0.6, our third patch release following Nim 1.0.0.

Featured projects


SPA framework

Karax is a framework for developing single page applications in Nim. Leverage Nim's macro system to produce a framework that allows for the development of applications that are boilerplate free.


Ethereum client

Nimbus aims to be a sharding client for Ethereum 2.0 Blockchain. Ethereum will potentially be on embedded systems, Nimbus will be designed to perform well on IoT and personal mobile devices.

Learn Nim today

Build command-line applications, games, web servers, kernels and everything else in between. Nim has a low barrier to entry and offers powerful features you won't find in many mainstream programming languages.

Nim in Action

The first Nim book, Nim in Action, is now available for purchase as an eBook or printed soft cover book. Learn the basics such as Nim's syntax and advanced features including macros, and gain practical experience with the language by being led through multiple application development examples.

  • Teaches the basics including the syntax of Nim.
  • Explains how to use the Nimble package manager.
  • Includes step-by-step instructions and explanations of how to develop various applications, including a chat program, a Twitter clone and more.

Support Nim

Join the 100+ companies and individuals that support Nim

The Nim project is developed globally by a group of volunteers. We welcome recurring donations, which enable us to spend more time working on Nim.

Top sponsors

See more


Looking for the GitHub repository?

The Nim compiler and tools are all written in Nim and licensed under the MIT license, with most development taking place on GitHub. Be sure to watch the repository to get updates on Nim's development, or star it to give us some brownie points.