Taking inspiration from multiple languages, the Nim syntax is
easily understood and results in code that can be modified very
effectively.
Indentation significant syntax
Multiple constructs inspired by Python
Multi-line lambdas
It combines successful concepts from Ada and Modula.
Support for multiple operating systems
Nim supports every mainstream operating system and platform as
well as multiple niche platforms. We take pride in supporting all
three major operating systems fully.
JavaScript compilation
Nim includes a first-class JavaScript backend so you can target the
client and server effortlessly at the same time.
New Game: NPlay/Pause: PControls: ← → ↑ ↓
The above game is written in Nim, compiled using the JavaScript
backend and drawn using the canvas API.
Nim implements a small core language with a powerful
set of metaprogramming features.
The metaprogramming features in Nim include support for generics,
templates, and macros. This allows Nim to be extended with support
for various programming paradigms and allows developers to avoid
boilerplate. The standard library
implements async await using these metaprogramming features and
the Nim community has developed various packages implementing
different programming paradigms.
Decentralised package management
The Nim package manager is called Nimble. Packages
are distributed via Git and Mercurial repositories, and tags are
queried remotely to determine version information.
A mapping between package names and repository URLs is defined in a
packages.json file that is stored on
GitHub.
Packages are defined using a
specially formatted .nimble file that is evaluated by the
Nim compiler. This means that it supports a large subset of the
Nim programming language, allowing various powerful features including
the ability to determine the OS and specify external dependencies.
Nim makes it easy to bind to C, C++ and Objective C libraries.
This allows developers to easily access a large ecosystem of
mature and powerful libraries.
When a Nim application crashes with an exception,
it will output a stack trace before terminating. The format of this
stack trace is very easy to grasp and contains all the required
information to debug the exception.