Department of Mathematics FAS Harvard University One Oxford Street Cambridge MA 02138 USA Tel: (617) 495-2171 Fax: (617) 495-5132
FAS Computer Services to Harvard University IT: (617) 495-7777.
Nim is statically typed, imperative programming language which runs on all major platforms. It can generate C++ or objective C code and can therefore be good to generate fast and small executables without dependencies.
Here is an example
from strutils import parseInt
type person  = tuple[name: string, age: int, profession: string]
var  p:  person 
var name: string = readLine(stdin)
echo("Hi,",name, "! age?")
var age:  int = parseInt(readLine(stdin))
echo(name, "What is your profession?
")
var profession:  string = readLine(stdin)
p = (name: name, age: age, profession: profession)
echo(p.name," ",repr(p.age)," ",p.profession)

test.nim
compile with 
nim compile test.nim




Simplicity, Clarity, Generality B.W. Kernighan, R. Pike, in "The Practice of Programming".
Privacy
HTML CSS