<s>
Nim	B-Application
is	O
a	O
general-purpose	B-Language
,	O
multi-paradigm	O
,	O
statically	O
typed	O
,	O
compiled	B-Language
high-level	B-Language
systems	B-Language
programming	I-Language
language	I-Language
,	O
designed	O
and	O
developed	O
by	O
a	O
team	O
around	O
Andreas	O
Rumpf	O
.	O
</s>
<s>
Nim	B-Application
is	O
designed	O
to	O
be	O
"	O
efficient	O
,	O
expressive	O
,	O
and	O
elegant	O
"	O
,	O
supporting	O
metaprogramming	B-Application
,	O
functional	B-Language
,	O
message	B-Architecture
passing	I-Architecture
,	O
procedural	B-Application
,	O
and	O
object-oriented	B-Language
programming	I-Language
styles	O
by	O
providing	O
several	O
features	O
such	O
as	O
compile	B-Application
time	I-Application
code	O
generation	O
,	O
algebraic	O
data	O
types	O
,	O
a	O
foreign	B-Application
function	I-Application
interface	I-Application
(	O
FFI	O
)	O
with	O
C	B-Language
,	O
C++	B-Language
,	O
Objective-C	B-Language
,	O
and	O
JavaScript	B-Language
,	O
and	O
supporting	O
compiling	B-Language
to	O
those	O
same	O
languages	O
as	O
intermediate	B-Application
representations	I-Application
.	O
</s>
<s>
Nim	B-Application
was	O
created	O
to	O
be	O
a	O
language	O
as	O
fast	O
as	O
C	B-Language
,	O
as	O
expressive	O
as	O
Python	B-Language
,	O
and	O
as	O
extensible	O
as	O
Lisp	B-Language
.	O
</s>
<s>
Nim	B-Application
is	O
statically	O
typed	O
.	O
</s>
<s>
It	O
supports	O
compile-time	B-Application
metaprogramming	B-Application
features	O
such	O
as	O
syntactic	O
macros	O
and	O
term	O
rewriting	O
macros	O
.	O
</s>
<s>
Term	O
rewriting	O
macros	O
enable	O
library	B-Library
implementations	O
of	O
common	O
data	O
structures	O
,	O
such	O
as	O
bignums	O
and	O
matrices	O
,	O
to	O
be	O
implemented	O
efficiently	O
,	O
as	O
if	O
they	O
were	O
built-in	O
language	O
facilities	O
.	O
</s>
<s>
Iterators	O
are	O
supported	O
and	O
can	O
be	O
used	O
as	O
first	O
class	O
entities	O
,	O
as	O
can	O
functions	O
,	O
allowing	O
for	O
the	O
use	O
of	O
functional	B-Language
programming	I-Language
methods	O
.	O
</s>
<s>
Object-oriented	B-Language
programming	I-Language
is	O
supported	O
by	O
inheritance	B-Language
and	O
multiple	O
dispatch	O
.	O
</s>
<s>
Functions	O
can	O
be	O
generic	O
,	O
they	O
can	O
be	O
overloaded	O
,	O
and	O
generics	B-Language
are	O
further	O
enhanced	O
by	O
Nim	B-Application
's	O
support	O
for	O
type	O
classes	O
.	O
</s>
<s>
Nim	B-Application
includes	O
tunable	O
automatic	B-General_Concept
garbage	I-General_Concept
collection	I-General_Concept
based	O
on	O
deferred	O
reference	B-General_Concept
counting	I-General_Concept
with	O
cycle	O
detection	O
,	O
which	O
can	O
also	O
be	O
turned	O
off	O
altogether	O
.	O
</s>
<s>
,	O
Nim	B-Application
compiles	B-Language
to	O
C	B-Language
,	O
C++	B-Language
,	O
JavaScript	B-Language
,	O
and	O
Objective-C	B-Language
.	O
</s>
<s>
Nim	B-Application
's	O
initial	O
development	O
was	O
started	O
in	O
2005	O
by	O
Andreas	O
Rumpf	O
.	O
</s>
<s>
It	O
was	O
originally	O
named	O
Nimrod	B-Application
when	O
the	O
project	O
was	O
made	O
public	O
in	O
2008	O
.	O
</s>
<s>
The	O
first	O
version	O
of	O
the	O
Nim	B-Application
compiler	B-Language
was	O
written	O
in	O
Pascal	B-Application
using	O
the	O
Free	B-Operating_System
Pascal	I-Operating_System
compiler	I-Operating_System
.	O
</s>
<s>
In	O
2008	O
,	O
a	O
version	O
of	O
the	O
compiler	B-Language
written	O
in	O
Nim	B-Application
was	O
released	O
.	O
</s>
<s>
The	O
compiler	B-Language
is	O
free	B-License
and	I-License
open-source	I-License
software	I-License
,	O
and	O
is	O
being	O
developed	O
by	O
a	O
community	O
of	O
volunteers	O
working	O
with	O
Andreas	O
Rumpf	O
.	O
</s>
<s>
The	O
language	O
was	O
officially	O
renamed	O
from	O
Nimrod	B-Application
to	O
Nim	B-Application
with	O
the	O
release	O
of	O
version	O
0.10.2	O
in	O
December	O
2014	O
.	O
</s>
<s>
On	O
September	O
23	O
,	O
2019	O
,	O
version	O
1.0.0	O
of	O
Nim	B-Application
was	O
released	O
,	O
signifying	O
the	O
maturing	O
of	O
the	O
language	O
and	O
its	O
toolchain	O
.	O
</s>
<s>
The	O
syntax	O
of	O
Nim	B-Application
resembles	O
that	O
of	O
Python	B-Language
.	O
</s>
<s>
Code	O
blocks	O
and	O
nesting	O
statements	O
are	O
identified	O
through	O
use	O
of	O
whitespace	O
,	O
according	O
to	O
the	O
offside-rule	B-Language
.	O
</s>
<s>
Many	O
keywords	O
are	O
identical	O
to	O
their	O
Python	B-Language
equivalents	O
,	O
which	O
are	O
mostly	O
English	O
keywords	O
,	O
whereas	O
other	O
programming	O
languages	O
usually	O
use	O
punctuation	O
.	O
</s>
<s>
With	O
the	O
goal	O
of	O
improving	O
upon	O
its	O
influence	O
languages	O
,	O
even	O
though	O
Nim	B-Application
supports	O
indentation-based	O
syntax	O
like	O
Python	B-Language
,	O
it	O
introduced	O
additional	O
flexibility	O
.	O
</s>
<s>
And	O
Nim	B-Application
supports	O
user-defined	O
operators	O
.	O
</s>
<s>
Unlike	O
Python	B-Language
,	O
Nim	B-Application
implements	O
(	O
native	O
)	O
static	O
typing	O
.	O
</s>
<s>
Nim	B-Application
's	O
type	O
system	O
allows	O
for	O
easy	O
type	O
conversion	O
,	O
casting	O
,	O
and	O
provides	O
syntax	O
for	O
generic	B-Language
programming	I-Language
.	O
</s>
<s>
Nim	B-Application
notably	O
provides	O
type	O
classes	O
which	O
can	O
stand	O
in	O
for	O
multiple	O
types	O
,	O
and	O
provides	O
several	O
such	O
type	O
classes	O
'	O
out	O
of	O
the	O
box	O
 '	O
.	O
</s>
<s>
Historically	O
,	O
Nim	B-Application
was	O
fully	O
case-insensitive	O
(	O
capitalization	O
of	O
the	O
identifiers	O
was	O
fully	O
ignored	O
)	O
and	O
underscores	O
were	O
completely	O
ignored	O
,	O
too	O
.	O
</s>
<s>
Nim	B-Application
was	O
influenced	O
by	O
specific	O
characteristics	O
of	O
existing	O
languages	O
,	O
including	O
the	O
following	O
:	O
</s>
<s>
Nim	B-Application
supports	O
Uniform	O
Function	O
Call	O
Syntax	O
(	O
UFCS	O
)	O
and	O
identifier	O
equality	O
,	O
which	O
provides	O
a	O
large	O
degree	O
of	O
flexibility	O
in	O
use	O
.	O
</s>
<s>
Except	O
for	O
the	O
first	O
letter	O
,	O
identifiers	O
in	O
Nim	B-Application
are	O
compared	O
in	O
a	O
case-insensitive	O
manner	O
,	O
and	O
underscores	O
are	O
ignored	O
.	O
</s>
<s>
The	O
stropping	B-Application
feature	O
allows	O
the	O
use	O
of	O
any	O
name	O
for	O
variables	O
or	O
functions	O
,	O
even	O
when	O
the	O
names	O
are	O
reserved	O
words	O
for	O
keywords	O
.	O
</s>
<s>
An	O
example	O
of	O
stropping	B-Application
is	O
the	O
ability	O
to	O
define	O
a	O
variable	O
named	O
if	O
,	O
without	O
clashing	O
with	O
the	O
keyword	O
if	O
.	O
</s>
<s>
Nim	B-Application
's	O
implementation	O
of	O
this	O
is	O
achieved	O
via	O
backticks	O
,	O
allowing	O
any	O
reserved	O
word	O
to	O
be	O
used	O
as	O
an	O
identifier	O
.	O
</s>
<s>
The	O
Nim	B-Application
compiler	B-Language
emits	O
fast	O
,	O
optimized	O
C	B-Language
code	O
by	O
default	O
.	O
</s>
<s>
It	O
defers	O
compiling-to-object	O
code	O
to	O
an	O
external	O
C	B-Language
compiler	B-Language
to	O
leverage	O
existing	O
compiler	B-Language
optimization	O
and	O
portability	O
.	O
</s>
<s>
Many	O
C	B-Language
compilers	B-Language
are	O
supported	O
,	O
including	O
Clang	B-Application
,	O
Microsoft	B-Application
Visual	I-Application
C++	I-Application
(	O
MSVC	B-Application
)	O
,	O
MinGW	B-Application
,	O
and	O
GNU	B-Application
Compiler	I-Application
Collection	I-Application
(	O
GCC	B-Application
)	O
.	O
</s>
<s>
The	O
Nim	B-Application
compiler	B-Language
can	O
also	O
emit	O
C++	B-Language
,	O
Objective-C	B-Language
,	O
and	O
JavaScript	B-Language
code	O
to	O
allow	O
easy	O
interfacing	O
with	O
application	O
programming	O
interfaces	O
(	O
APIs	B-General_Concept
)	O
written	O
in	O
those	O
languages	O
;	O
developers	O
can	O
simply	O
write	O
in	O
Nim	B-Application
,	O
then	O
compile	B-Language
to	O
any	O
supported	O
language	O
.	O
</s>
<s>
This	O
also	O
allows	O
writing	O
applications	O
for	O
iOS	B-Application
and	O
Android	B-Application
.	O
</s>
<s>
There	O
is	O
also	O
an	O
unofficial	O
LLVM	B-Application
backend	O
,	O
allowing	O
use	O
of	O
the	O
Nim	B-Application
compiler	B-Language
in	O
a	O
stand-alone	O
way	O
.	O
</s>
<s>
The	O
Nim	B-Application
compiler	B-Language
is	O
self-hosting	O
,	O
meaning	O
it	O
is	O
written	O
in	O
the	O
Nim	B-Application
language	I-Application
.	O
</s>
<s>
The	O
compiler	B-Language
supports	O
cross-compiling	O
,	O
so	O
it	O
is	O
able	O
to	O
compile	B-Language
software	O
for	O
any	O
of	O
the	O
supported	O
operating	O
systems	O
,	O
no	O
matter	O
the	O
development	O
machine	O
.	O
</s>
<s>
This	O
is	O
useful	O
for	O
compiling	B-Language
applications	O
for	O
embedded	O
systems	O
,	O
and	O
for	O
uncommon	O
and	O
obscure	O
computer	O
architectures	O
.	O
</s>
<s>
By	O
default	O
,	O
the	O
Nim	B-Application
compiler	B-Language
creates	O
a	O
debug	O
build	O
.	O
</s>
<s>
With	O
the	O
option	O
-d:release	O
a	O
release	O
build	O
can	O
be	O
created	O
,	O
which	O
is	O
optimized	O
for	O
speed	O
and	O
contains	O
fewer	O
runtime	O
checks	O
.	O
</s>
<s>
With	O
the	O
option	O
-d:danger	O
all	O
runtime	O
checks	O
can	O
be	O
disabled	O
,	O
if	O
maximum	O
speed	O
is	O
desired	O
.	O
</s>
<s>
Nim	B-Application
supports	O
multiple	O
memory	O
management	O
strategies	O
,	O
including	O
the	O
following	O
:	O
</s>
<s>
It	O
's	O
a	O
deferred	O
reference	B-General_Concept
counting	I-General_Concept
based	O
garbage	B-General_Concept
collector	I-General_Concept
with	O
a	O
simple	O
Mark&Sweep	O
backup	O
GC	O
in	O
order	O
to	O
collect	O
cycles	O
.	O
</s>
<s>
--gc:markAndSweep	O
–	O
Simple	O
Mark-And-Sweep	O
based	O
garbage	B-General_Concept
collector	I-General_Concept
.	O
</s>
<s>
--gc:boehm	O
–	O
Boehm	O
based	O
garbage	B-General_Concept
collector	I-General_Concept
,	O
it	O
offers	O
a	O
shared	O
heap	O
.	O
</s>
<s>
--gc:go	O
–	O
Go	B-Application
's	O
garbage	B-General_Concept
collector	I-General_Concept
,	O
useful	O
for	O
interoperability	O
with	O
Go	B-Application
.	O
</s>
<s>
--gc:arc	O
–	O
Plain	O
reference	B-General_Concept
counting	I-General_Concept
with	O
move	O
semantic	O
optimizations	O
,	O
offers	O
a	O
shared	O
heap	O
.	O
</s>
<s>
--gc:none	O
–	O
No	O
memory	O
management	O
strategy	O
nor	O
a	O
garbage	B-General_Concept
collector	I-General_Concept
.	O
</s>
<s>
Many	O
tools	O
are	O
bundled	O
with	O
the	O
Nim	B-Application
install	O
package	O
,	O
including	O
:	O
</s>
<s>
Nimble	O
is	O
the	O
standard	O
package	B-Application
manager	I-Application
used	O
by	O
Nim	B-Application
to	O
package	O
Nim	B-Application
modules	O
.	O
</s>
<s>
It	O
was	O
initially	O
developed	O
by	O
Dominik	O
Picheta	O
,	O
who	O
is	O
also	O
a	O
core	O
Nim	B-Application
developer	O
.	O
</s>
<s>
Nimble	O
has	O
been	O
included	O
as	O
Nim	B-Application
's	O
official	O
package	B-Application
manager	I-Application
since	O
Oct	O
27	O
,	O
2015	O
,	O
the	O
v0.12.0	O
release	O
.	O
</s>
<s>
These	O
files	O
support	O
a	O
limited	O
subset	O
of	O
the	O
Nim	B-Application
syntax	O
called	O
NimScript	O
,	O
with	O
the	O
main	O
limitation	O
being	O
the	O
access	O
to	O
the	O
FFI	O
.	O
</s>
<s>
The	O
list	O
of	O
packages	O
is	O
stored	O
in	O
a	O
JavaScript	B-General_Concept
Object	I-General_Concept
Notation	I-General_Concept
(	O
JSON	B-General_Concept
)	O
file	O
which	O
is	O
freely	O
accessible	O
in	O
the	O
nim-lang/packages	O
repository	O
on	O
GitHub	B-Application
.	O
</s>
<s>
This	O
JSON	B-General_Concept
file	O
provides	O
Nimble	O
with	O
a	O
mapping	O
between	O
the	O
names	O
of	O
packages	O
and	O
their	O
Git	B-Application
or	O
Mercurial	O
repository	O
URLs	O
.	O
</s>
<s>
Nimble	O
comes	O
with	O
the	O
Nim	B-Application
compiler	B-Language
.	O
</s>
<s>
This	O
command	O
will	O
reveal	O
the	O
version	O
number	O
,	O
compiling	B-Language
date	O
and	O
time	O
,	O
and	O
Git	B-Application
hash	O
of	O
nimble	O
.	O
</s>
<s>
Nimble	O
uses	O
the	O
Git	B-Application
package	O
,	O
which	O
must	O
be	O
available	O
for	O
Nimble	O
to	O
function	O
properly	O
.	O
</s>
<s>
c2nim	O
is	O
a	O
source-to-source	B-Language
compiler	I-Language
(	O
transcompiler	B-Language
or	O
transpiler	B-Language
)	O
meant	O
to	O
be	O
used	O
on	O
C/C	O
++	O
headers	O
to	O
help	O
generate	O
new	O
Nim	B-Application
bindings	O
.	O
</s>
<s>
The	O
output	O
is	O
human-readable	O
Nim	B-Application
code	O
that	O
is	O
meant	O
to	O
be	O
edited	O
by	O
hand	O
after	O
the	O
translation	O
process	O
.	O
</s>
<s>
koch	O
is	O
a	O
maintenance	O
script	O
that	O
is	O
used	O
to	O
build	O
Nim	B-Application
,	O
and	O
provide	O
HTML	O
documentation	O
.	O
</s>
<s>
It	O
is	O
included	O
to	O
assist	O
with	O
searching	O
Nim	B-Application
's	O
style-insensitive	O
identifiers	O
.	O
</s>
<s>
nimsuggest	O
is	O
a	O
tool	O
that	O
helps	O
any	O
source	O
code	O
editor	O
query	O
a	O
.nim	O
source	O
file	O
to	O
obtain	O
useful	O
information	O
like	O
definition	O
of	O
symbols	O
or	O
suggestions	O
for	O
completions	O
.	O
</s>
<s>
niminst	O
is	O
a	O
tool	O
to	O
generate	O
an	O
installer	O
for	O
a	O
Nim	B-Application
program	O
.	O
</s>
<s>
It	O
creates	O
.msi	O
installers	O
for	O
Windows	O
via	O
Inno	O
Setup	O
,	O
and	O
install	O
and	O
uninstall	O
scripts	O
for	O
Linux	B-Application
,	O
macOS	B-Application
,	O
and	O
Berkeley	B-Operating_System
Software	I-Operating_System
Distribution	I-Operating_System
(	O
BSD	B-Operating_System
)	O
.	O
</s>
<s>
nimpretty	O
is	O
a	O
source	O
code	O
beautifier	O
,	O
used	O
to	O
format	O
code	O
according	O
to	O
the	O
official	O
Nim	B-Application
style	O
guide	O
.	O
</s>
<s>
is	O
an	O
advanced	O
automatic	O
Unittests	O
runner	O
for	O
Nim	B-Application
tests	O
.	O
</s>
<s>
Used	O
in	O
developing	O
Nim	B-Application
,	O
it	O
offers	O
process	O
isolation	O
tests	O
,	O
generates	O
statistics	O
about	O
test	O
cases	O
,	O
supports	O
multiple	O
targets	O
and	O
simulated	O
Dry-Runs	O
,	O
has	O
logging	O
,	O
can	O
generate	O
HTML	O
reports	O
,	O
can	O
skip	O
tests	O
from	O
a	O
file	O
,	O
and	O
more	O
.	O
</s>
<s>
Some	O
notable	O
tools	O
not	O
included	O
in	O
the	O
Nim	B-Application
package	O
include	O
:	O
</s>
<s>
was	O
developed	O
by	O
Dominik	O
Picheta	O
,	O
creator	O
of	O
the	O
Nimble	O
package	B-Application
manager	I-Application
,	O
as	O
a	O
tool	O
to	O
enable	O
installing	O
and	O
using	O
multiple	O
versions	O
of	O
the	O
Nim	B-Application
compiler	B-Language
.	O
</s>
<s>
It	O
downloads	O
any	O
Nim	B-Application
stable	O
or	O
development	O
compiler	B-Language
version	O
from	O
the	O
command	O
line	O
,	O
enabling	O
easy	O
switching	O
between	O
them	O
.	O
</s>
<s>
is	O
a	O
library	B-Library
that	O
enables	O
convenient	O
Python	B-Language
integration	O
in	O
Nim	B-Application
programs	O
.	O
</s>
<s>
is	O
a	O
tool	O
focused	O
on	O
automating	O
the	O
creation	O
of	O
C/C	O
++	O
wrappers	O
needed	O
for	O
Nim	B-Application
's	O
foreign	B-Application
function	I-Application
interface	I-Application
.	O
</s>
<s>
Pure	O
libraries	O
are	O
modules	O
written	O
in	O
Nim	B-Application
only	O
.	O
</s>
<s>
Impure	O
libraries	O
are	O
modules	O
of	O
Nim	B-Application
code	O
which	O
depend	O
on	O
external	O
libraries	O
that	O
are	O
written	O
in	O
other	O
programming	O
languages	O
such	O
as	O
C	B-Language
.	O
</s>
<s>
The	O
Nim	B-Application
standard	O
library	B-Library
includes	O
modules	O
for	O
all	O
basic	O
tasks	O
,	O
including	O
:	O
</s>
<s>
A	O
Nim	B-Application
program	O
can	O
use	O
any	O
library	B-Library
which	O
can	O
be	O
used	O
in	O
a	O
C	B-Language
,	O
C++	B-Language
,	O
or	O
JavaScript	B-Language
program	O
.	O
</s>
<s>
Language	B-Application
bindings	I-Application
exist	O
for	O
many	O
libraries	O
,	O
including	O
GTK	B-Application
,	O
Qt	B-Language
QML	O
,	O
wxWidgets	B-Language
,	O
Simple	B-Operating_System
DirectMedia	I-Operating_System
Layer	I-Operating_System
(	O
SDL	O
)	O
2	O
,	O
Cairo	B-Language
,	O
OpenGL	B-Application
,	O
Windows	B-Library
API	I-Library
(	O
WinAPI	B-Library
)	O
,	O
zlib	B-Language
,	O
libzip	B-Application
,	O
OpenSSL	B-Language
,	O
Vulkan	B-Application
and	O
cURL	B-Language
.	O
</s>
<s>
Nim	B-Application
works	O
with	O
PostgreSQL	B-Application
,	O
MySQL	B-Application
,	O
and	O
SQLite	B-Language
databases	O
.	O
</s>
<s>
Nim	B-Application
can	O
interface	O
with	O
the	O
Lua	B-Language
,	O
Julia	B-Application
,	O
Rust	B-Application
,	O
</s>
<s>
C#	B-Application
,	O
</s>
<s>
TypeScript	B-Language
,	O
</s>
<s>
and	O
Python	B-Language
programming	I-Language
languages	I-Language
.	O
</s>
<s>
program	O
in	O
Nim	B-Application
:	O
</s>
<s>
Program	O
to	O
calculate	O
the	O
factorial	O
of	O
a	O
positive	O
integer	O
using	O
the	O
iterative	O
approach:Using	O
the	O
module	O
math	O
from	O
Nim	B-Application
's	O
standard	O
library	B-Library
:	O
</s>
<s>
A	O
simple	O
demonstration	O
showing	O
many	O
of	O
Nim	B-Application
's	O
features	O
.	O
</s>
<s>
Every	O
procedure	O
in	O
Nim	B-Application
with	O
a	O
non-void	O
return	O
type	O
has	O
an	O
implicit	O
result	O
variable	O
that	O
represents	O
the	O
value	O
to	O
be	O
returned	O
.	O
</s>
<s>
If	O
an	O
iterator	O
is	O
omitted	O
,	O
the	O
compiler	B-Language
will	O
attempt	O
to	O
use	O
an	O
items	O
iterator	O
,	O
if	O
one	O
is	O
defined	O
for	O
the	O
type	O
specified	O
.	O
</s>
<s>
Using	O
GTK3	B-Application
with	O
gobject	O
introspection	O
through	O
the	O
module	O
:	O
</s>
<s>
This	O
code	O
requires	O
the	O
gintro	O
module	O
to	O
work	O
,	O
which	O
is	O
not	O
part	O
of	O
the	O
standard	O
library	B-Library
.	O
</s>
<s>
To	O
install	O
the	O
module	O
gintro	O
and	O
many	O
others	O
you	O
can	O
use	O
the	O
tool	O
nimble	O
,	O
which	O
comes	O
as	O
part	O
of	O
nim	B-Application
.	O
</s>
<s>
Functional	B-Language
programming	I-Language
is	O
supported	O
in	O
Nim	B-Application
through	O
first-class	B-Application
functions	I-Application
and	O
code	O
without	O
side	O
effects	O
via	O
the	O
`noSideEffect`	O
pragma	O
,	O
the	O
`func`	O
keyword	O
and	O
the	O
experimental	O
feature	O
`strictFuncs`	O
.	O
</s>
<s>
With	O
the	O
`strictFuncs`	O
feature	O
enabled	O
,	O
Nim	B-Application
will	O
perform	O
side	O
effect	O
analysis	O
and	O
raise	O
compilation	B-Language
errors	O
for	O
code	O
that	O
does	O
not	O
obey	O
the	O
contract	O
of	O
producing	O
no	O
side	O
effects	O
.	O
</s>
<s>
Contrary	O
to	O
purely	O
functional	B-Language
programming	I-Language
languages	I-Language
,	O
Nim	B-Application
is	O
a	O
multi-paradigm	O
programming	O
language	O
,	O
so	O
functional	B-Language
programming	I-Language
restrictions	O
are	O
opt-in	O
on	O
a	O
function-by-function	O
basis	O
.	O
</s>
<s>
Nim	B-Application
supports	O
first-class	B-Application
functions	I-Application
by	O
allowing	O
functions	O
to	O
be	O
stored	O
in	O
variables	O
or	O
passed	O
as	O
parameters	O
to	O
be	O
invoked	O
by	O
other	O
functions	O
.	O
</s>
<s>
This	O
is	O
an	O
example	O
of	O
metaprogramming	B-Application
in	O
Nim	B-Application
using	O
its	O
template	O
facilities	O
.	O
</s>
<s>
The	O
genType	O
is	O
invoked	O
at	O
compile-time	B-Application
and	O
a	O
Test	O
type	O
is	O
created	O
.	O
</s>
<s>
Nim	B-Application
supports	O
both	O
constrained	O
and	O
unconstrained	O
generic	B-Language
programming	I-Language
.	O
</s>
<s>
Generics	B-Language
may	O
be	O
used	O
in	O
procedures	O
,	O
templates	O
and	O
macros	O
.	O
</s>
<s>
In	O
addThese	O
,	O
T	O
is	O
the	O
generic	B-Language
type	I-Language
,	O
the	O
compiler	B-Language
will	O
accept	O
any	O
values	O
for	O
this	O
function	O
as	O
long	O
as	O
both	O
parameters	O
and	O
the	O
return	O
value	O
are	O
of	O
the	O
same	O
type	O
.	O
</s>
<s>
Macros	O
can	O
rewrite	O
parts	O
of	O
the	O
code	O
at	O
compile-time	B-Application
.	O
</s>
<s>
Nim	B-Application
macros	O
are	O
powerful	O
and	O
can	O
do	O
many	O
operations	O
on	O
the	O
abstract	B-Data_Structure
syntax	I-Data_Structure
tree	I-Data_Structure
.	O
</s>
<s>
The	O
twice	O
macro	O
in	O
this	O
example	O
takes	O
the	O
echo	O
statement	O
in	O
the	O
form	O
of	O
an	O
abstract	B-Data_Structure
syntax	I-Data_Structure
tree	I-Data_Structure
as	O
input	O
.	O
</s>
<s>
The	O
result	O
is	O
that	O
the	O
code	O
gets	O
rewritten	O
by	O
the	O
macro	O
to	O
look	O
like	O
the	O
following	O
code	O
at	O
compile	B-Application
time	I-Application
:	O
</s>
<s>
Nim	B-Application
's	O
FFI	O
is	O
used	O
to	O
call	O
functions	O
written	O
in	O
the	O
other	O
programming	O
languages	O
that	O
it	O
can	O
compile	B-Language
to	O
.	O
</s>
<s>
This	O
means	O
that	O
libraries	O
written	O
in	O
C	B-Language
,	O
C++	B-Language
,	O
Objective-C	B-Language
,	O
and	O
JavaScript	B-Language
can	O
be	O
used	O
in	O
the	O
Nim	B-Application
source	O
code	O
.	O
</s>
<s>
One	O
should	O
be	O
aware	O
that	O
both	O
JavaScript	B-Language
and	O
C	B-Language
,	O
C++	B-Language
,	O
or	O
Objective-C	B-Language
libraries	O
cannot	O
be	O
combined	O
in	O
the	O
same	O
program	O
,	O
as	O
they	O
are	O
not	O
as	O
compatible	O
with	O
JavaScript	B-Language
as	O
they	O
are	O
with	O
each	O
other	O
.	O
</s>
<s>
Both	O
C++	B-Language
and	O
Objective-C	B-Language
are	O
based	O
on	O
and	O
compatible	O
with	O
C	B-Language
,	O
but	O
JavaScript	B-Language
is	O
incompatible	O
,	O
as	O
a	O
dynamic	O
,	O
client-side	O
web-based	O
language	O
.	O
</s>
<s>
The	O
following	O
program	O
shows	O
the	O
ease	O
with	O
which	O
external	O
C	B-Language
code	O
can	O
be	O
used	O
directly	O
in	O
Nim	B-Application
.	O
</s>
<s>
In	O
this	O
code	O
the	O
printf	O
function	O
is	O
imported	O
into	O
Nim	B-Application
and	O
then	O
used	O
.	O
</s>
<s>
Basic	O
example	O
using	O
'	O
console.log	O
'	O
directly	O
for	O
the	O
JavaScript	B-Language
compilation	B-Language
target	O
:	O
</s>
<s>
The	O
JavaScript	B-Language
code	O
produced	O
by	O
the	O
Nim	B-Application
compiler	B-Language
can	O
be	O
executed	O
with	O
Node.js	B-Language
or	O
a	O
web	O
browser	O
.	O
</s>
<s>
To	O
activate	O
threading	O
support	O
in	O
Nim	B-Application
,	O
a	O
program	O
should	O
be	O
compiled	B-Language
with	O
--threads:on	O
command	O
line	O
argument	O
.	O
</s>
<s>
Each	O
thread	O
has	O
a	O
separate	O
garbage	B-General_Concept
collected	I-General_Concept
heap	O
and	O
sharing	O
of	O
memory	O
is	O
restricted	O
,	O
which	O
helps	O
with	O
efficiency	O
and	O
stops	O
race	O
conditions	O
by	O
the	O
threads.Nim	O
also	O
has	O
a	O
channels	O
module	O
that	O
simplifies	O
passing	O
data	O
between	O
threads	O
.	O
</s>
<s>
Nim	B-Application
supports	O
asynchronous	O
IO	B-Application
via	O
the	O
asyncdispatch	O
module	O
,	O
which	O
adds	O
async/await	O
syntax	O
via	O
the	O
macro	O
system	O
.	O
</s>
<s>
An	O
example	O
of	O
an	O
asynchronous	O
http	B-Protocol
server	O
:	O
</s>
<s>
Nim	B-Application
has	O
an	O
active	O
community	O
on	O
the	O
self-hosted	O
,	O
self-developed	O
official	O
forum	O
.	O
</s>
<s>
Further	O
,	O
the	O
project	O
uses	O
a	O
Git	B-Application
repository	O
,	O
bug	O
tracker	O
,	O
and	O
wiki	O
hosted	O
by	O
GitHub	B-Application
,	O
where	O
the	O
community	O
engages	O
with	O
the	O
language	O
.	O
</s>
<s>
The	O
first	O
Nim	B-Application
conference	O
,	O
NimConf	O
,	O
took	O
place	O
on	O
June	O
20	O
,	O
2020	O
.	O
</s>
<s>
It	O
was	O
held	O
digitally	O
due	O
to	O
COVID-19	O
,	O
with	O
an	O
open	O
call	O
for	O
contributor	O
talks	O
in	O
the	O
form	O
of	O
YouTube	B-General_Concept
videos	I-General_Concept
.	O
</s>
<s>
The	O
conference	O
began	O
with	O
language	O
overviews	O
by	O
Nim	B-Application
developers	O
Andreas	O
Rumpf	O
and	O
Dominik	O
Picheta	O
.	O
</s>
<s>
Presentation	O
topics	O
included	O
talks	O
about	O
Nim	B-Application
web	O
frameworks	O
,	O
mobile	B-Application
development	I-Application
,	O
Internet	B-Operating_System
of	I-Operating_System
things	I-Operating_System
(	O
IoT	B-Operating_System
)	O
devices	O
,	O
and	O
game	O
development	O
,	O
including	O
a	O
talk	O
about	O
writing	O
Nim	B-Application
for	O
Game	B-Device
Boy	I-Device
Advance	I-Device
.	O
</s>
<s>
NimConf	O
2020	O
is	O
available	O
as	O
a	O
YouTube	B-General_Concept
playlist	O
.	O
</s>
<s>
In	O
addition	O
to	O
official	O
conferences	O
,	O
Nim	B-Application
has	O
been	O
featured	O
at	O
various	O
other	O
conventions	O
.	O
</s>
<s>
A	O
presentation	O
on	O
Nim	B-Application
was	O
given	O
at	O
the	O
O'Reilly	O
Open	O
Source	O
Convention	O
(	O
OSCON	O
)	O
in	O
2015	O
.	O
</s>
<s>
Four	O
speakers	O
represented	O
Nim	B-Application
at	O
Free	B-License
and	I-License
Open	I-License
source	I-License
Software	I-License
Developers	O
 '	O
European	O
Meeting	O
(	O
FOSDEM	O
)	O
2020	O
,	O
including	O
the	O
creator	O
of	O
the	O
language	O
,	O
Andreas	O
Rumpf	O
.	O
</s>
