nim-by-example/content/index.md
2014-12-12 17:46:20 -05:00

23 lines
678 B
Markdown

---
title: Main
---
# Nim by Example
[Nim] is a powerful statically typed language that allows the programmer expressiveness without compromising run-time performance. As a general purpose programming language, it gives the same sort of power and performance as C++, but in a nicer package and with even more powerful tools!
[Nim]: http://nim-lang.org/
Getting started? Head over to the [installation instructions](/getting_started/)!
``` nim
import tables, strutils
var wordFrequencies = initCountTable[string]()
for line in stdin.lines:
for word in line.split(", "):
wordFrequencies.inc(word)
echo "The most frequent word is '", wordFrequencies.largest, "'"
```