
Nim supports Uniform Function Call Syntax (UFCS) and identifier equality, which provides a large degree of flexibility in use.įor example, each of these lines does the same call, just with different syntax:

#Microsoft open xml converter uninstall code#
This code sample demonstrates the use of typeclasses in Nim SomeOrdinal - Represents all the basic countable and ordered types, except of non integer number.SomeInteger - Represents all the Integer types, signed or not.SomeSignedInt - Represents all the signed integer types.Type classes allow working with several types as if they were a single type. Nim notably provides type classes which can stand in for multiple types, and provides several such type classes 'out of the box'. Nim's type system allows for easy type conversion, casting, and provides syntax for generic programming. Unlike Python, Nim implements (native) static typing. Additionally, Nim supports user-defined operators. With the goal of improving upon its influence languages, even though Nim supports indentation-based syntax like Python, it introduced additional flexibility one may break statements with a comma or binary operator to the next line. Many keywords are identical to their Python equivalents, which are mostly English keywords, whereas other programming languages usually use punctuation. Code blocks and nesting statements are identified through use of whitespace, according to the offside-rule. The syntax of Nim resembles that of Python. Older version, yet still maintained: 1.4.8 Older version, yet still maintained: 1.2.18 Older version, yet still maintained: 1.0.10 Old version, no longer maintained: 0.20.2 Old version, no longer maintained: 0.19.6 Old version, no longer maintained: 0.18.0 Old version, no longer maintained: 0.17.2 Old version, no longer maintained: 0.16.0 Old version, no longer maintained: 0.15.2 Old version, no longer maintained: 0.14.2 Old version, no longer maintained: 0.13.0 Old version, no longer maintained: 0.12.0

Old version, no longer maintained: 0.11.2 Old version, no longer maintained: 0.10.2 presents a most original design that straddles Pascal and Python and compiles to C code or JavaScript. Nim includes tunable automatic garbage collection based on deferred reference counting with cycle detection, which can also be turned off altogether. Functions can be generic, they can be overloaded, and generics are further enhanced by Nim's support for type classes. Object-oriented programming is supported by inheritance and multiple dispatch.

Iterators are supported and can be used as first class entities, as can functions, allowing for the use of functional programming methods.

Term rewriting macros enable library implementations of common data structures, such as bignums and matrices, to be implemented efficiently, as if they were built-in language facilities. It supports compile-time metaprogramming features such as syntactic macros and term rewriting macros. Nim was created to be a language as fast as C, as expressive as Python, and as extensible as Lisp.
