Best ways to make your first contribution to Nim language for Hacktoberfest 2021
Tags: python, opensource, nim, hacktoberfest
Published: 2021-10-05 04:57:50

Concise and readable, small binaries, fast compile times, native performance, zero-overhead interop lets you reuse code in C, C++, JS, Objective-C, Python... Does a programming language have these fantastic features? Of course, [Nim language](https://github.com/nim-lang/Nim) does have the features I have been dreaming about. And what is the goal of Nim language? Simply put, the goal is "one language to rule them all", from [shell scripting](https://nim-lang.org/docs/nims.html) to [web frontend and backend](https://github.com/nim-lang/nimforum),
  [scientific computing](https://github.com/SciNim), [deep learning](https://github.com/mratsim/Arraymancer),
  [blockchain client](https://github.com/status-im), [gamedev](https://github.com/ftsf/nico),
  [embedded](https://github.com/EmbeddedNim).

Moreover, [Nim](https://github.com/nim-lang/Nim) is a community driven collaborative effort that welcomes all contributions, big or small. Read [contributing guide](https://github.com/nim-lang/Nim#contributing) if you are willing to contribute to Nim. In this article, I will tell you best ways to make your first contribution to Nim language. Starting from easy and feasible pull requests, you will surely enjoy the charm of open source projects. Let's start our journey.

## Replace code-block with runnableExamples
Some modules are using code-blocks which are outdated and should be replaced by `runnableExamples`. Search `.. code-block` in your favourite editor and change the ones in standard libraries.

For instance

**before**
```nim
## .. code-block:: Nim
##   import std/json
##
##   let jsonNode = parseJson("""{"key": 3.14}""")
##
##   doAssert jsonNode.kind == JObject
##   doAssert jsonNode["key"].kind == JFloat
```
**after**
```nim
runnableExamples:
  let jsonNode = parseJson("""{"key": 3.14}""")
  doAssert jsonNode.kind == JObject
  doAssert jsonNode["key"].kind == JFloat
```
Note that the import of the current module can be left out. If the original snippet cannot be run, use `runnableExamples("-r:off")` instead.


## Add testcase to close issues
When surfing [issues](https://github.com/nim-lang/Nim/issues) of Nim, you can find some code which have already worked. Submit a pull request to close that issue. You can refer to https://github.com/nim-lang/Nim/pull/18934 and track issues labelled as [works_but_needs_test_case](https://github.com/nim-lang/Nim/labels/works_but_needs_test_case) or [works_with_arc_orc](https://github.com/nim-lang/Nim/labels/works_with_arc_orc).

## Add top-level runnableExamples for modules
Some modules lack top-level runnableExamples, please help them. Such as:
- https://github.com/nim-lang/Nim/blob/devel/lib/pure/concurrency/cpuload.nim
- https://github.com/nim-lang/Nim/blob/devel/lib/pure/concurrency/threadpool.nim
- https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncstreams.nim
- https://github.com/nim-lang/Nim/blob/devel/lib/pure/cookies.nim
- https://github.com/nim-lang/Nim/blob/devel/lib/pure/endians.nim
- https://github.com/nim-lang/Nim/blob/devel/lib/pure/volatile.nim


## Add runnableExamples or documentations for procs

Some procs lack corresponding runnableExamples and documentations. Please find them and complete them.

## Solve issues labelled as easy

If you like some challenges, start from [issues](https://github.com/nim-lang/Nim/issues?q=is%3Aissue+is%3Aopen+label%3AEasy) labelled as easy.