DEV Community

Cover image for Hello World In NimLang
Ahmed Muhammed Galadima
Ahmed Muhammed Galadima

Posted on

3 2

Hello World In NimLang

nim is a statically typed systems programming language that can compile to C,C++ and even JavaScript! thus nim can be used for either frontend development, back-end development and embedded development.


Getting started with nim

to get started all you need is the nim compiler which you can install at download-nim

To check if you have nim installed just run in a terminal

$ nim --version
Enter fullscreen mode Exit fullscreen mode

this should output the compiler version and a few other stuffs.

Writing some Nim

to get started all you need is a file that ends with the *.nim* extension

hello world in nim

put this in your .nim file

echo "hello world"
Enter fullscreen mode Exit fullscreen mode

now you need to compile and run your program, which can be easily done by doing

nim compile --run filename.nim
Enter fullscreen mode Exit fullscreen mode

the compile command will compile and leave an executable binary file for you. but the --run will immediately run the code for you!.

and there!, you've written your first line of code in Nim and you shouldn't stop there.. the nim website has a very well built tutorial that can get any new or seasoned developer up and running with the nim language so go try it out now!. 😄

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay