Nim · online compiler

Run Nim online

Run Nim 2 online — Python-clean syntax, C-fast binaries.

Version
Firecracker microVM live per-test verdicts multi-file compile

Nim reads like Python and compiles to C (also C++, JS, ObjC). Statically typed, garbage collected (with options), templates and macros for metaprogramming.

ls-judge compiles Nim 2.x with the standard compiler inside a Firecracker microVM.

Starter code

What you get in Nim

Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.

nim
Nim 2
import strutils
let n = parseInt(readLine(stdin))
echo n * 2
stdin →21
expected →42
FAQ

Common questions about Nim on ls-judge

Nim 1 or 2?
Nim 2 — the current stable major.
Nimble packages?
No network — standard library only.
Compile backend?
C by default.
Free?
Yes.
Further reading
Also try