Download the compiler
You can download the latest version of the Nim compiler here.
Since the website moved to https, only installation via the provided zipfiles is supported:
32 bit: nim-0.16.0_x32.zip
64 bit: nim-0.16.0_x64.zip
Unzip these where you want and optionally run finish.exe to detect your MingW environment. (Though that's not reliable yet.)
You can find the required DLLs here, if you lack them for some reason:
32 and 64 bit: DLLs.zip
These versions of mingw are known to work:
32 bit: mingw32-6.3.0
64 bit: mingw64-6.3.0
Installation based on generated C code
Note: The Nim compiler requires a C compiler to compile software. On Windows we recommend that you use Mingw-w64. GCC is recommended on Linux and Clang on Mac. The Windows installers above already includes a C compiler.
This installation method is the preferred way for Linux, Mac OS X, and other Unix like systems.
Firstly, download this archive:
Extract the archive. Then copy the extracted files into your chosen installation directory, ideally somewhere in your home directory. For example: ~/programs/nim.
Now open a terminal and follow these instructions:
- cd into your installation directory, for example by executing
- run sh build.sh.
- Add $your_install_dir/bin to your PATH.
- To build associated tools like nimble and nimsuggest run nim c koch && ./koch tools.
After restarting your terminal, you should be able to run nim -v which should show you the version of Nim you just installed.
There are other ways to install Nim (like using the install.sh script), but these tend to cause more problems.
Bleeding edge installation from GitHub
GitHub is where Nim's development takes place. You may wish to grab the latest development version of Nim, because sometimes bug fixes and new features may not have made it to an official release yet. In those circumstances you are better off grabbing the current development branch.
You will also need to do this if you would like to contribute to Nim.
Before you download the code, open a new terminal and cd into the directory where you would like the download to take place.
The following commands can be used to download the current development branch and then to build it:
git clone https://github.com/nim-lang/Nim.git cd Nim git clone --depth 1 https://github.com/nim-lang/csources cd csources && sh build.sh cd .. bin/nim c koch ./koch boot -d:release
You should then add the ./bin (make sure to expand this into an absolute path) directory to your PATH.
The official Docker images are published on Docker Hub and include the compiler and Nimble. There are images for standalone scripts as well as Nimble packages.
Get the latest stable image:
docker pull nimlang/nim
The latest development version:
docker pull nimlang/nim:devel