Most developers will agree that having automatic tests is a good thing. With good tests we can make changes to our code and test whether these changes causes old bugs to resurface, new bugs to appear, or current workflows to be broken.
In this tutorial we will have a look at how the default testing setup works in Nimble, the official Nim package manager/build tool which is installed along Nim.
nimble init
When you first create a…
Recently I was met with an interesting problem when wrapping a C library in Nim. The library in question was MAPM, an older but quite complete library for dealing with arbitrary precision maths. Unfortunately the library doesn’t have much in the way of error handling. If something goes wrong it almost always writes to stderr
and returns the number 0. And to be fair, there isn’t a whole lot that can go wrong in…
Nim is a great candidate for server development, but if you want to run your own server and are new to the world of server management or Linux there can be a daunting amount of information to consume in order to do it right. In this article I’ll give a quick rundown of setting up a small server capable of running your Nim server in a safe way. It is much more low-level than many…
As we discovered in my last article, Nim will by default generate C code and then call on a C compiler to actually produce a binary. This might seem like an odd choice, especially in the age of LLVM. However it’s actually not uncommon for languages to compile or transpile into another language. Initially the choice to not use LLVM was simply because it wasn’t as mature back when Nim was created. Though going through…
This is a question which has been asked in various places over the years, and recently on the forum in multiple separate threads. Seeing how I’ve built commercial software with Nim dynamic libraries, I thought I’d chime in with my knowledge. But since there are multiple threads out there and this is a large-ish topic I figured it would be better to do it as a post on here.
As you’re probably aware Nim…