• Stars
    star
    682
  • Rank 66,258 (Top 2 %)
  • Language
    Nim
  • License
    BSD 3-Clause "New...
  • Created almost 8 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tool for easily installing and managing multiple versions of the Nim programming language.

choosenim

choosenim installs the Nim programming language from official downloads and sources, enabling you to easily switch between stable and development compilers.

The aim of this tool is two-fold:

  • Provide an easy way to install the Nim compiler and tools.
  • Manage multiple Nim installations and allow them to be selected on-demand.

Typical usage

To select the current stable release of Nim:

$ choosenim stable
  Installed component 'nim'
  Installed component 'nimble'
  Installed component 'nimgrep'
  Installed component 'nimpretty'
  Installed component 'nimsuggest'
  Installed component 'testament'
   Switched to Nim 1.0.0
$ nim -v
Nim Compiler Version 1.0.0 [Linux: amd64]

To update to the latest stable release of Nim:

$ choosenim update stable

To display which versions are currently installed:

$ choosenim show
  Selected: 1.6.6
   Channel: stable
      Path: /home/dom/.choosenim/toolchains/nim-1.6.6

  Versions:
            #devel
          * 1.6.6
            1.0.0
            #v1.0.0

Versions can be selected via choosenim 1.6.6 or by branch/tag name via choosenim #devel (note that selecting branches is likely to require Nim to be bootstrapped which may be slow).

Installation

Windows

Download the latest Windows version from the releases page (the .zip file, for example here is v0.7.4).

Extract the zip archive and run the runme.bat script. Follow any on screen prompts and enjoy your new Nim and choosenim installation.


There is also a third-party project to provide an installer for choosenim, you can find it here (note that this isn't vetted by the Nim team so you do so at your own risk).

Unix

curl https://nim-lang.org/choosenim/init.sh -sSf | sh
wget -qO - https://nim-lang.org/choosenim/init.sh | sh

Optional: You can specify the initial version you would like the init.sh script to install by specifying the CHOOSENIM_CHOOSE_VERSION environment variable.

How choosenim works

Similar to the likes of rustup and pyenv, choosenim is a toolchain multiplexer. It installs and manages multiple Nim toolchains and presents them all through a single set of tools installed in ~/.nimble/bin.

The nim, nimble and other tools installed in ~/.nimble/bin are proxies that delegate to the real toolchain. choosenim then allows you to change the active toolchain by reconfiguring the behaviour of the proxies.

The toolchains themselves are installed into ~/.choosenim/toolchains. For example running nim will execute the proxy in ~/.nimble/bin/nim, which in turn will run the compiler in ~/.choosenim/toolchains/nim-1.0.0/bin/nim, assuming that 1.0.0 was selected.

How toolchains are installed

choosenim downloads and installs the official release binaries on Windows and Linux. On other platforms, the official source release is downloaded and built. This operation is only performed once when a new version is selected.

As official binaries are made available for more platforms, choosenim will install them accordingly.

Dependencies

Windows Linux macOS (*)
C compiler Downloaded automatically gcc/clang gcc/clang
OpenSSL N/A N/A N/A
curl N/A Any recent version (※) Any recent version

* Many macOS dependencies should already be installed. You may need to install a C compiler however. More information on dependencies is available here.

※ Some users needed to install libcurl4-gnutls-dev (see here)

Git is required when installing #HEAD or a specific commit of Nim. The unxz binary is optional but will allow choosenim to download the smallest tarballs.

Usage

> choosenim -h
choosenim: The Nim toolchain installer.

Choose a job. Choose a mortgage. Choose life. Choose Nim.

Usage:
  choosenim <version/path/channel>

Example:
  choosenim 1.0.0
    Installs (if necessary) and selects version 0.16.0 of Nim.
  choosenim stable
    Installs (if necessary) Nim from the stable channel (latest stable release)
    and then selects it.
  choosenim #head
    Installs (if necessary) and selects the latest current commit of Nim.
    Warning: Your shell may need quotes around `#head`: choosenim "#head".
  choosenim ~/projects/nim
    Selects the specified Nim installation.
  choosenim update stable
    Updates the version installed on the stable release channel.
  choosenim versions [--installed]
    Lists the available versions of Nim that choosenim has access to.

Channels:
  stable
    Describes the latest stable release of Nim.
  devel
    Describes the latest development (or nightly) release of Nim taken from
    the devel branch.

Commands:
  update    <version/channel>    Installs the latest release of the specified
                                 version or channel.
  show                           Displays the selected version and channel.
  show      path                 Prints only the path of the current Nim version.
  update    self                 Updates choosenim itself.
  versions  [--installed]        Lists available versions of Nim, passing
                                 `--installed` only displays versions that
                                 are installed locally (no network requests).

Options:
  -h --help             Show this output.
  -y --yes              Agree to every question.
  --version             Show version.
  --verbose             Show low (and higher) priority output.
  --debug               Show debug (and higher) priority output.
  --noColor             Don't colorise output.

  --choosenimDir:<dir>  Specify the directory where toolchains should be
                        installed. Default: ~/.choosenim.
  --nimbleDir:<dir>     Specify the Nimble directory where binaries will be
                        placed. Default: ~/.nimble.
  --firstInstall        Used by install script.

Analytics

Check out the analytics document for details.

License

MIT

More Repositories

1

jester

A sinatra-like web framework for Nim.
Nim
1,569
star
2

nimkernel

A small kernel written in Nim
Nim
615
star
3

httpbeast

A highly performant, multi-threaded HTTP 1.1 server written in Nim.
Nim
447
star
4

Aporia

IDE/Advanced text editor mainly focusing on support for the Nim programming language.
Nim
383
star
5

snake

A little snake game in Nim
Nim
207
star
6

nim-in-action-code

Nim in Action code samples
Nim
197
star
7

deauther

An interactive command-line deauther for macOS.
Nim
72
star
8

nim-opencv

Nim OpenCV wrapper
Nim
55
star
9

ipsumgenera

Static blog generator written in Nim
Nim
51
star
10

webdriver

Nim
46
star
11

gamelight

A set of simple modules for writing 2D games targeting JS/Android/iOS in Nim.
Nim
41
star
12

SimpleIRC

IRC Library for Haskell
Haskell
36
star
13

nimbox

Fork of https://notabug.org/vktec/nimbox
Nim
30
star
14

untar

Nim library for decompressing tar.gz files.
Nim
29
star
15

nael

Stack-based language similar to Factor.
Nim
26
star
16

prometheus

Prometheus instrumentation library for Nim
Nim
26
star
17

irc

Nim IRC module
Nim
22
star
18

binary_size

Shell
21
star
19

notifications

A small library for displaying notifications
Nim
17
star
20

pycloud

Experimental Pyodide fork which works in Cloudflare Workers
JavaScript
15
star
21

gbemulator

GameBoy emulator written in Nim
Nim
15
star
22

ElysiaBot

Modular Haskell IRC Bot
Haskell
12
star
23

nimbuild

Nim's build farm
Nim
12
star
24

sass

Nim bindings to the libsass C++ library
Nim
12
star
25

texttospeech

A Nim client for the Google Cloud Text to Speech API.
Nim
11
star
26

osinfo

Modules providing information about the OS for Nim
Nim
10
star
27

nim-jsonrpc

Nim
9
star
28

webasmio

A prototype library for selectively compiling Nim functions into Web Assembly
Nim
9
star
29

aoc2019

Advent of Code 2019 in Nim
Nim
7
star
30

analytics

A Google Analytics reporting library for Nim
Nim
7
star
31

tictactoe-rs

Tic Tac Toe in Rust
Rust
6
star
32

chirper.picheta.me

Browser extension which integrates Mastodon with Twitter.
HTML
6
star
33

xchat-exaile-script

A script which announces the currently played song in exaile. For xchat.
Python
5
star
34

stock_notifier

Nim
4
star
35

pwned

A client for the Pwned passwords API.
Nim
4
star
36

GeneticAlgorithms

Genetic algorithm experiments
Python
3
star
37

andromeda

ogame clone written in haskell
3
star
38

nyx

Old Python GTK IRC Client
Python
3
star
39

pb

Simple command line pastebin app.
Haskell
3
star
40

c4hbot

An IRC bot which lets you play Card Against Humanity. Written in Nim.
Nim
3
star
41

DynreckIRC

Lightweight, efficient and fast Python IRC Library
Python
2
star
42

vec

Nim
2
star
43

nim-urbanterror

Nimrod module for communicating with Urban Terror servers over UDP.
Nim
2
star
44

ld43

Nim
2
star
45

ld40

Nim
2
star
46

geckodriver-travis

Barebones example showing how to test a Jester app on Travis with Gecko driver.
Nim
2
star
47

MDSBot

Modular IRC Bot made in Python
Python
2
star
48

himari

My crappy toy OS
C
2
star
49

radiotap

Nim
2
star
50

dom96.github.com

2
star
51

adventofcode

Nim
2
star
52

nimrod-on-android

Attempt to run nimrod on the android platform
C
2
star
53

tinyrenderer.nim

C++
2
star
54

libclang

Nim
1
star
55

turingsim

Turing simulator written in Nim. Inspired by QUB's CSC2005.
Nim
1
star
56

qub-university-codesmash

http://shopkeep.github.io/qub-university-codesmash
Ruby
1
star
57

futurehack

It's a game thing.
C++
1
star
58

AELC

AEL(Awesome Esoteric Language) Interpreter
1
star
59

arduino

Messy repo with various Arduino experiments.
C++
1
star
60

oui

Parser for the official OUI file.
Nim
1
star
61

log2html

Tool for gathering information from HTTP server access logs.
1
star
62

CSC-Java

Java
1
star
63

corewlan

Nim
1
star
64

RPNCalc

A Reverse Polish Notation calculator made in various languages
Haskell
1
star
65

relnotesgen

Release notes generator
Nim
1
star
66

pyodide-worker-hello-world

Template to run Python via Pyodide on Cloudflare Workers
JavaScript
1
star