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
|