DEV Community

ringabout
ringabout

Posted on

9 3

Best ways to make your first contribution to Nim language for Hacktoberfest 2021

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 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 to web frontend and backend,
scientific computing, deep learning,
blockchain client, gamedev,
embedded.

Moreover, Nim is a community driven collaborative effort that welcomes all contributions, big or small. Read contributing guide 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

## .. code-block:: Nim
##   import std/json
##
##   let jsonNode = parseJson("""{"key": 3.14}""")
##
##   doAssert jsonNode.kind == JObject
##   doAssert jsonNode["key"].kind == JFloat
Enter fullscreen mode Exit fullscreen mode

after

runnableExamples:
  let jsonNode = parseJson("""{"key": 3.14}""")
  doAssert jsonNode.kind == JObject
  doAssert jsonNode["key"].kind == JFloat
Enter fullscreen mode Exit fullscreen mode

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 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 or works_with_arc_orc.

Add top-level runnableExamples for modules

Some modules lack top-level runnableExamples, please help them. Such as:

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 labelled as easy.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

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