Nim is a statically typed programming language with a simple syntax <ref name="Nim Syntax">{{cite web|url=https://akehrer.github.io/nim/2015/01/05/getting-started-with-nim.html|title=Nim Syntax|work=AkehrerOfficial Blogwebsite|accessdate=2015-03-27}}</ref>. Nim supports compile-time metaprogramming features such as ASTsyntactic macros and term rewriting macros,.<ref name="manualNim macros">{{cite web|url=httphttps://nim-langen.wikipedia.org/manual.htmlwiki/Macro_(computer_science)#Syntactic_macros|title=NimSyntactic ManualMacros|work=Official websiteWikipedia|accessdate=20142015-0703-2027}}</ref> the combination of these features is largely unique to Nim.<ref name="trforummanual">{{cite web|url=http://forum.nim-lang.org/t/70manual.html|title=TermNim rewriting macros|last=AraqManual|work=NimOfficial Forum|date=2012-09-10website|accessdate=2014-07-20}}</ref> Term rewriting macros enable library implementations of common data structures such as bignums and matrixes to be implemented with an efficiency as if they would have been builtin language facilities. Iterators are supported and can be used as first class entities<ref name="manual"/> in the language as can functions, these features allow for [[functional programming]] to be used. Object oriented programming is supported by inheritance and [[multiple dispatch]]. Functions can be generic and can also be overloaded, generics are further enhanced by the support for type classes. Operator overloading is also supported.<ref name="manual"/>
== Examples ==
The following code examples are valid as of Nim 0.10.2. Beware that syntaxSyntax and semantics may change in subsequent versions.