Nim is a general-purpose programming language known for its python-like syntax and ability to compile to multiple languages like C, C++, and JavaScript. Learn the fundamentals of Nim in this quick tutorial. 

#programming #code #100SecondsOfCode

💬 Chat with Me on Discord

https://discord.gg/fireship

🔗 Resources

Nim Docs https://nim-lang.org/
C in 100 Seconds https://youtu.be/U3aXWizDbQ4
Python in 100 Seconds https://youtu.be/x7X9w_GIm1s
Lisp in 100 Seconds https://youtu.be/INUHCQST7CU

🔥 Get More Content - Upgrade to PRO

Upgrade at https://fireship.io/pro
Use code YT25 for 25% off PRO access 

🎨 My Editor Settings

- Atom One Dark 
- vscode-icons
- Fira Code Font

🔖 Topics Covered

- What is the Nim language?
- Who created Nim?
- What is Nim used for?
- Nim basics tutorial
- Nim vs Rust
- Nim vs C
2024-02-04T05:17:34.966Z
nova-2
2-general-nova
2024-01-09.29447
30089e05-99d1-4376-b32e-c263170674af
dccb3414-c500-4ad5-9783-be78c47ee109
6c3754ab4eadd76b6cd06965feb68f85b34339acb879d532533c02137bab12e7
67875a7f-c9c4-48a0-aa55-5bdb8a91c34a
deprecated
NIM, a general purpose systems programming language that can deliver high performance native apps with concise elegant code.
It was created by Andreas Rump in Germany in 2005, who wanted a language with the performance of c, the productivity of Python, and the extensibility of Lisp.
Like other systems languages, NIM is statically we typed and compiled.
However, it's unique because its source code is first translated to a different language, usually c, then uses a compiler like Clang to convert it to GeneCo, and it can also transpile to c plus plus objective c, and even JavaScript.
By default, it uses a deterministic memory management strategy based on reference counting, but this behavior can be customized or removed altogether, allowing low level control over memory with pointers.
Syntactically, it feels like a statically typed Python, but it also provides extensive support for metaprogramming with a macro that allows direct access to the abstract syntax tree, allowing you to mold the language to your exact needs, much like the Lisp family of languages.
To get started, install it on your machine, then create a new file ending in dotnim.
Unlike c, no main function is necessary.
Use echo to print to the standard output or create a variable with the bar keyword and follow it with an optional type annotation.
Variables can be reassigned, but we can make them single assignment with lat or use const to make the assigned value immutable.
When writing a complex statement like an if condition, indentation matters like Python.
This keeps the code nice and readable like when declaring multiple variables.
For loops, it has a variety of built in iterators like count up and count down, or you can use the iterator keyword along with yield to build your own from scratch.
To define functions or methods, we use procedures, which can take input arguments and return a value.
It also supports closures and using procedures as arguments or return values for functional programming patterns.
However, it's also possible to use object oriented patterns by first creating a complex type, which can then be instantiated like a class.
And it also supports generics, allowing you to use types as parameters.
What makes NIM really special though is its support for meta programming.
For example, we can get the abstract syntax tree at any time using dump tree.
With this information, We can now write our own macros, which are like functions that modify the abstract syntax tree at compile time.
It's like writing Nimcode that writes more NIM code for you.
Now open the terminal and use the compiler to convert your NIM code into c and then into a machine code executable or use the JS command and to transpile it to JavaScript.
This has been NIM in 100 seconds.
Hit the like button if you wanna see more short videos like this.
Thanks for watching and I will see you in the next one.

Speaker 0: NIM, a general purpose systems programming language that can deliver high performance native apps with concise elegant code. It was created by Andreas Rump in Germany in 2005, who wanted a language with the performance of c, the productivity of Python, and the extensibility of Lisp. Like other systems languages, NIM is statically we typed and compiled. However, it's unique because its source code is first translated to a different language, usually c, then uses a compiler like Clang to convert it to GeneCo, and it can also transpile to c plus plus objective c, and even JavaScript. By default, it uses a deterministic memory management strategy based on reference counting, but this behavior can be customized or removed altogether, allowing low level control over memory with pointers.

Syntactically, it feels like a statically typed Python, but it also provides extensive support for metaprogramming with a macro that allows direct access to the abstract syntax tree, allowing you to mold the language to your exact needs, much like the Lisp family of languages. To get started, install it on your machine, then create a new file ending in dotnim. Unlike c, no main function is necessary. Use echo to print to the standard output or create a variable with the bar keyword and follow it with an optional type annotation. Variables can be reassigned, but we can make them single assignment with lat or use const to make the assigned value immutable.

When writing a complex statement like an if condition, indentation matters like Python. This keeps the code nice and readable like when declaring multiple variables. For loops, it has a variety of built in iterators like count up and count down, or you can use the iterator keyword along with yield to build your own from scratch. To define functions or methods, we use procedures, which can take input arguments and return a value. It also supports closures and using procedures as arguments or return values for functional programming patterns.

However, it's also possible to use object oriented patterns by first creating a complex type, which can then be instantiated like a class. And it also supports generics, allowing you to use types as parameters. What makes NIM really special though is its support for meta programming. For example, we can get the abstract syntax tree at any time using dump tree. With this information, We can now write our own macros, which are like functions that modify the abstract syntax tree at compile time.

It's like writing Nimcode that writes more NIM code for you. Now open the terminal and use the compiler to convert your NIM code into c and then into a machine code executable or use the JS command and to transpile it to JavaScript. This has been NIM in 100 seconds. Hit the like button if you wanna see more short videos like this. Thanks for watching and I will see you in the next one.
NIM, a general purpose systems programming language that can deliver high performance native apps with concise elegant code. It was created by Andreas Rump in Germany in 2005, who wanted a language with the performance of c, the productivity of Python, and the extensibility of Lisp. Like other systems languages, NIM is statically we typed and compiled.
programming
However, it's unique because its source code is first translated to a different language, usually c, then uses a compiler like Clang to convert it to GeneCo, and it can also transpile to c plus plus objective c, and even JavaScript.
By default, it uses a deterministic memory management strategy based on reference counting, but this behavior can be customized or removed altogether, allowing low level control over memory with pointers. Syntactically, it feels like a statically typed Python, but it also provides extensive support for metaprogramming with a macro that allows direct access to the abstract syntax tree, allowing you to mold the language to your exact needs, much like the Lisp family of languages. To get started, install it on your machine, then create a new file ending in dotnim.
languages
programming
logic
linguistics
Unlike c, no main function is necessary. Use echo to print to the standard output or create a variable with the bar keyword and follow it with an optional type annotation.
Variables can be reassigned, but we can make them single assignment with lat or use const to make the assigned value immutable. When writing a complex statement like an if condition, indentation matters like Python. This keeps the code nice and readable like when declaring multiple variables. For loops, it has a variety of built in iterators like count up and count down, or you can use the iterator keyword along with yield to build your own from scratch. To define functions or methods, we use procedures, which can take input arguments and return a value. It also supports closures and using procedures as arguments or return values for functional programming patterns. However, it's also possible to use object oriented patterns by first creating a complex type, which can then be instantiated like a class.
logical reasoning
logic
programming
And it also supports generics, allowing you to use types as parameters. What makes NIM really special though is its support for meta programming. For example, we can get the abstract syntax tree at any time using dump tree.
With this information, We can now write our own macros, which are like functions that modify the abstract syntax tree at compile time. It's like writing Nimcode that writes more NIM code for you. Now open the terminal and use the compiler to convert your NIM code into c and then into a machine code executable or use the JS command and to transpile it to JavaScript. This has been NIM in 100 seconds. Hit the like button if you wanna see more short videos like this. Thanks for watching and I will see you in the next one.
programming
youtube
NIM, a general purpose systems programming language that can deliver high performance native apps with concise elegant code. It was created by Andreas Rump in Germany in 2005, who wanted a language with the performance of c, the productivity of Python, and the extensibility of Lisp. Like other systems languages, NIM is statically we typed and compiled. However, it's unique because its source code is first translated to a different language, usually c, then uses a compiler like Clang to convert it to GeneCo, and it can also transpile to c plus plus objective c, and even JavaScript. By default, it uses a deterministic memory management strategy based on reference counting, but this behavior can be customized or removed altogether, allowing low level control over memory with pointers. Syntactically, it feels like a statically typed Python, but it also provides extensive support for metaprogramming with a macro that allows direct access to the abstract syntax tree, allowing you to mold the language to your exact needs, much like the Lisp family of languages. To get started, install it on your machine, then create a new file ending in dotnim. Unlike c, no main function is necessary. Use echo to print to the standard output or create a variable with the bar keyword and follow it with an optional type annotation. Variables can be reassigned, but we can make them single assignment with lat or use const to make the assigned value immutable. When writing a complex statement like an if condition, indentation matters like Python. This keeps the code nice and readable like when declaring multiple variables. For loops, it has a variety of built in iterators like count up and count down, or you can use the iterator keyword along with yield to build your own from scratch. To define functions or methods, we use procedures, which can take input arguments and return a value. It also supports closures and using procedures as arguments or return values for functional programming patterns. However, it's also possible to use object oriented patterns by first creating a complex type, which can then be instantiated like a class. And it also supports generics, allowing you to use types as parameters. What makes NIM really special though is its support for meta programming. For example, we can get the abstract syntax tree at any time using dump tree. With this information, We can now write our own macros, which are like functions that modify the abstract syntax tree at compile time. It's like writing Nimcode that writes more NIM code for you. Now open the terminal and use the compiler to convert your NIM code into c and then into a machine code executable or use the JS command and to transpile it to JavaScript. This has been NIM in 100 seconds. Hit the like button if you wanna see more short videos like this. Thanks for watching and I will see you in the next one.
NIM,
nim
a
a
general
general
purpose
purpose
systems
systems
programming
programming
language
language
that
that
can
can
deliver
deliver
high
high
performance
performance
native
native
apps
apps
with
with
concise
concise
elegant
elegant
code.
code
It
it
was
was
created
created
by
by
Andreas
andreas
Rump
rump
in
in
Germany
germany
in
in
2005,
2005
who
who
wanted
wanted
a
a
language
language
with
with
the
the
performance
performance
of
of
c,
c
the
the
productivity
productivity
of
of
Python,
python
and
and
the
the
extensibility
extensibility
of
of
Lisp.
lisp
Like
like
other
other
systems
systems
languages,
languages
NIM
nim
is
is
statically
statically
we
we
typed
typed
and
and
compiled.
compiled
However,
however
it's
it's
unique
unique
because
because
its
its
source
source
code
code
is
is
first
first
translated
translated
to
to
a
a
different
different
language,
language
usually
usually
c,
c
then
then
uses
uses
a
a
compiler
compiler
like
like
Clang
clang
to
to
convert
convert
it
it
to
to
GeneCo,
geneco
and
and
it
it
can
can
also
also
transpile
transpile
to
to
c
c
plus
plus
plus
plus
objective
objective
c,
c
and
and
even
even
JavaScript.
javascript
By
by
default,
default
it
it
uses
uses
a
a
deterministic
deterministic
memory
memory
management
management
strategy
strategy
based
based
on
on
reference
reference
counting,
counting
but
but
this
this
behavior
behavior
can
can
be
be
customized
customized
or
or
removed
removed
altogether,
altogether
allowing
allowing
low
low
level
level
control
control
over
over
memory
memory
with
with
pointers.
pointers
Syntactically,
syntactically
it
it
feels
feels
like
like
a
a
statically
statically
typed
typed
Python,
python
but
but
it
it
also
also
provides
provides
extensive
extensive
support
support
for
for
metaprogramming
metaprogramming
with
with
a
a
macro
macro
that
that
allows
allows
direct
direct
access
access
to
to
the
the
abstract
abstract
syntax
syntax
tree,
tree
allowing
allowing
you
you
to
to
mold
mold
the
the
language
language
to
to
your
your
exact
exact
needs,
needs
much
much
like
like
the
the
Lisp
lisp
family
family
of
of
languages.
languages
To
to
get
get
started,
started
install
install
it
it
on
on
your
your
machine,
machine
then
then
create
create
a
a
new
new
file
file
ending
ending
in
in
dotnim.
dotnim
Unlike
unlike
c,
c
no
no
main
main
function
function
is
is
necessary.
necessary
Use
use
echo
echo
to
to
print
print
to
to
the
the
standard
standard
output
output
or
or
create
create
a
a
variable
variable
with
with
the
the
bar
bar
keyword
keyword
and
and
follow
follow
it
it
with
with
an
an
optional
optional
type
type
annotation.
annotation
Variables
variables
can
can
be
be
reassigned,
reassigned
but
but
we
we
can
can
make
make
them
them
single
single
assignment
assignment
with
with
lat
lat
or
or
use
use
const
const
to
to
make
make
the
the
assigned
assigned
value
value
immutable.
immutable
When
when
writing
writing
a
a
complex
complex
statement
statement
like
like
an
an
if
if
condition,
condition
indentation
indentation
matters
matters
like
like
Python.
python
This
this
keeps
keeps
the
the
code
code
nice
nice
and
and
readable
readable
like
like
when
when
declaring
declaring
multiple
multiple
variables.
variables
For
for
loops,
loops
it
it
has
has
a
a
variety
variety
of
of
built
built
in
in
iterators
iterators
like
like
count
count
up
up
and
and
count
count
down,
down
or
or
you
you
can
can
use
use
the
the
iterator
iterator
keyword
keyword
along
along
with
with
yield
yield
to
to
build
build
your
your
own
own
from
from
scratch.
scratch
To
to
define
define
functions
functions
or
or
methods,
methods
we
we
use
use
procedures,
procedures
which
which
can
can
take
take
input
input
arguments
arguments
and
and
return
return
a
a
value.
value
It
it
also
also
supports
supports
closures
closures
and
and
using
using
procedures
procedures
as
as
arguments
arguments
or
or
return
return
values
values
for
for
functional
functional
programming
programming
patterns.
patterns
However,
however
it's
it's
also
also
possible
possible
to
to
use
use
object
object
oriented
oriented
patterns
patterns
by
by
first
first
creating
creating
a
a
complex
complex
type,
type
which
which
can
can
then
then
be
be
instantiated
instantiated
like
like
a
a
class.
class
And
and
it
it
also
also
supports
supports
generics,
generics
allowing
allowing
you
you
to
to
use
use
types
types
as
as
parameters.
parameters
What
what
makes
makes
NIM
nim
really
really
special
special
though
though
is
is
its
its
support
support
for
for
meta
meta
programming.
programming
For
for
example,
example
we
we
can
can
get
get
the
the
abstract
abstract
syntax
syntax
tree
tree
at
at
any
any
time
time
using
using
dump
dump
tree.
tree
With
with
this
this
information,
information
We
we
can
can
now
now
write
write
our
our
own
own
macros,
macros
which
which
are
are
like
like
functions
functions
that
that
modify
modify
the
the
abstract
abstract
syntax
syntax
tree
tree
at
at
compile
compile
time.
time
It's
it's
like
like
writing
writing
Nimcode
nimcode
that
that
writes
writes
more
more
NIM
nim
code
code
for
for
you.
you
Now
now
open
open
the
the
terminal
terminal
and
and
use
use
the
the
compiler
compiler
to
to
convert
convert
your
your
NIM
nim
code
code
into
into
c
c
and
and
then
then
into
into
a
a
machine
machine
code
code
executable
executable
or
or
use
use
the
the
JS
js
command
command
and
and
to
to
transpile
transpile
it
it
to
to
JavaScript.
javascript
This
this
has
has
been
been
NIM
nim
in
in
100
100
seconds.
seconds
Hit
hit
the
the
like
like
button
button
if
if
you
you
wanna
wanna
see
see
more
more
short
short
videos
videos
like
like
this.
this
Thanks
thanks
for
for
watching
watching
and
and
I
i
will
will
see
see
you
you
in
in
the
the
next
next
one.
one
success
The speaker explains the NIM language, which is a general purpose systems programming language used for native apps with concise code. NIM uses a deterministic memory management strategy and is flexible for metaprogramming. It supports metaprogramming and has support for meta programming, including creating a class and using procedures. The language is also flexible for creating variables and supports generics.
Nim in 100 Seconds
NIM, a general purpose systems programming language that can deliver high performance native apps with concise elegant code. It was created by Andreas Rump in Germany in 2005, who wanted a language with the performance of c, the productivity of Python, and the extensibility of Lisp. Like other systems languages, NIM is statically we typed and compiled. However, it's unique because its source code is first translated to a different language, usually c, then uses a compiler like Clang to convert it to GeneCo, and it can also transpile to c plus plus objective c, and even JavaScript. By default, it uses a deterministic memory management strategy based on reference counting, but this behavior can be customized or removed altogether, allowing low level control over memory with pointers. Syntactically, it feels like a statically typed Python, but it also provides extensive support for metaprogramming with a macro that allows direct access to the abstract syntax tree, allowing you to mold the language to your exact needs, much like the Lisp family of languages. To get started, install it on your machine, then create a new file ending in dotnim. Unlike c, no main function is necessary. Use echo to print to the standard output or create a variable with the bar keyword and follow it with an optional type annotation. Variables can be reassigned, but we can make them single assignment with lat or use const to make the assigned value immutable. When writing a complex statement like an if condition, indentation matters like Python. This keeps the code nice and readable like when declaring multiple variables. For loops, it has a variety of built in iterators like count up and count down, or you can use the iterator keyword along with yield to build your own from scratch. To define functions or methods, we use procedures, which can take input arguments and return a value. It also supports closures and using procedures as arguments or return values for functional programming patterns. However, it's also possible to use object oriented patterns by first creating a complex type, which can then be instantiated like a class. And it also supports generics, allowing you to use types as parameters. What makes NIM really special though is its support for meta programming. For example, we can get the abstract syntax tree at any time using dump tree. With this information, We can now write our own macros, which are like functions that modify the abstract syntax tree at compile time. It's like writing Nimcode that writes more NIM code for you. Now open the terminal and use the compiler to convert your NIM code into c and then into a machine code executable or use the JS command and to transpile it to JavaScript. This has been NIM in 100 seconds. Hit the like button if you wanna see more short videos like this. Thanks for watching and I will see you in the next one.
The speaker explains the NIM language, which is a general purpose systems programming language used for native apps with concise code. NIM uses a deterministic memory management strategy and is flexible for metaprogramming. It supports metaprogramming and has support for meta programming, including creating a class and using procedures. The language is also flexible for creating variables and supports generics.