Questions Columns Rows
GitHub icon

Nim

Nim - Programming language

< >

Nim is an open source programming language created in 2008 by Andreas Rumpf.

Source code:
git clone https://github.com/nim-lang/Nim
#105on PLDB 15Years Old 8kRepos

Try now: RijuTIO

Nim (formerly named Nimrod) is an imperative, multi-paradigm, compiled programming language designed and developed by Andreas Rumpf. It is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C and compiling to JavaScript, C and C++.. Read more on Wikipedia...


Example from Compiler Explorer:
# Type your code here, or load an example. proc square(num: int): int {.exportc.} = num * num
Example from Riju:
echo "Hello, world!"
Example from hello-world:
echo("Hello World")
# Hello world in Nim echo "Hello World"
Example from Linguist:
# from: https://github.com/nim-lang/Nim/blob/27b081d1f77604ee47c886e69dbc52f53ea3741f/compiler/nimfix/nimfix.nim.cfg # Special configuration file for the Nim project # gc:markAndSweep hint[XDeclaredButNotUsed]:off path:"$projectPath/.." path:"$lib/packages/docutils" path:"$nim" define:useStdoutAsStdmsg symbol:nimfix define:nimfix cs:partial #define:useNodeIds define:booting define:noDocgen
Example from Wikipedia:
proc printf(formatstr: cstring) {.header: "<stdio.h>", varargs.} printf("%s %d\n", "foo", 5)

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Stats Sponsor Traffic Traffic Today Day 267 feedback@pldb.com Logout