#! stdtmpl | standard #proc generateHTMLPage(c: var TConfigData, currentTab, content, rss: string): string = # result = "" $c.projectTitle #if len(rss) > 0: #end if # if currentTab == "index":
# else:
# end
# if currentTab == "index":

Nim looks like this..

# compute average line length
var
  sum = 0
  count = 0

for line in stdin.lines:
  sum += line.len
  count += 1

echo("Average line length: ",
  if count > 0: sum / count else: 0)

..and this...

# create and greet someone
type Person = object
  name: string
  age: int

proc greet(p: Person) =
  echo "Hi, I'm ", p.name, "."
  echo "I am ", p.age, " years old."

var p = Person(name:"Jon", age:18)
p.greet() # or greet(p)

Why should I be excited?

Nim is the only language that leverages automated proof technology to perform a disjoint check for your parallel code. Working on disjoint data means no locking is required and yet data races are impossible:
parallel:
  var i = 0
  while i <= a.high:
    spawn f(a[i])
    spawn f(a[i+1])
    # ERROR: cannot prove a[i] is disjoint from a[i+1]
    # BUT: replace 'i += 1' with 'i += 2' and the code compiles!
    i += 1
            

interfacing with C..

proc unsafeScanf(f: File; s: cstring)
  {.importc: "fscanf", 
    header: "<stdio.h>", varargs.}

var x: cint
unsafeScanf(stdin, "%d", addr x)
            

..and DSLs made easy

import jester, asyncdispatch, htmlgen

routes:
  get "/":
    resp h1("Hello world")

runForever()

Compile and run with:
nim c -r example.nim
View at: localhost:5000

# end
$content