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
after
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 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:
- 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 labelled as easy.
Top comments (0)