Skip to content

Latest commit

 

History

History
462 lines (425 loc) · 50.2 KB

README.md

File metadata and controls

462 lines (425 loc) · 50.2 KB

Welcome to Nim

Docker Pulls

Nim is a statically typed, imperative programming language that tries to give the programmer ultimate power without compromises on runtime efficiency. This means it focuses on compile-time mechanisms in all their various forms.

Beneath a nice infix/indentation based syntax with a powerful (AST based, hygienic) macro system lies a semantic model that supports a soft realtime GC on thread local heaps. Asynchronous message passing is used between threads, so no "stop the world" mechanism is necessary. An unsafe shared memory heap is also provided for the increased efficiency that results from that model.

Tags

Tags indicate Nim versions, base images, and flavors. For example, nimlang/nim:2.2.2-ubuntu-regular means Nim version 2.2.2, based on Ubuntu, with Nimble installed. Ubuntu is the default base, so you can omit it in the tag: nimlang/nim:2.2.2-regular. Regular is the default flavor, so you can omit it as well: nimlang/nim:2.2.2. The latest Nim version is additionally tagged as latest: nimlang/nim:latest. And since Docker adds latest automatically, you can just write nimlang/nim.

So, all together:

nimlang/nim = nimlang/nim:latest = nimlang/nim:2.2.2 = nimlang/nim:2.2.2-ubuntu =nimlang/nim:latest-ubuntu = nimlang/nim:2.2.2-regular = nimlang/nim:latest-regular = nimlang/nim:2.2.2-ubuntu-regular = nimlang/nim:latest-ubuntu-regular

Phew, that's one long list! Fortunately, unless you need a specific version of Nim, you'll probably need just nimlang/nim or nimlang/nim:alpine.

Should you want to install a devel branch of the nim compiler or manage multiple nim version we have a nimlang/choosenim image, which provides choosenim. choosenim is a tool designed for managing your nim installation, read more here.

Bases

There are currently two bases for nimlang/nim images: Ubuntu and Alpine. Ubuntu is the default one.

The nimlang/choosenim image is based on bitnami/minideb.

Flavors

nimlang/nim images come in two flavors: slim and regular. Slim images include only the Nim compiler. Regular images include the compiler and Nimble package manager.

Available Tags

Build Status

  • Latest version
  • 2.2.x branch
  • 2.0.x branch
  • 1.6.x branch
  • 1.4.x branch
  • 1.2.x branch
  • 1.0.x branch
  • 0.x.x branch

Using the Images

Get the Latest Version

$ docker pull nimlang/nim
$ docker pull nimlang/choosenim

Compiling a Single File

$ docker run --rm -v `pwd`:/usr/src/app -w /usr/src/app nimlang/nim nim c -r myapp.nim

Compiling a Static Single File

$ docker run --rm -v `pwd`:/usr/src/app -w /usr/src/app nimlang/nim:alpine nim c --passL:"-static -no-pie" myapp.nim