Hide
Scraps
RSS
Showing all entries tagged with: Guide

Multitasking in Nim

3rd September 2021

This is a series of articles about a topic in the Nim ecosystem that has so far been written fairly little about. Namely threading, asynchronous operation, and communication.

To begin we first need to have a good grasp of the concepts we're going to discuss. There is quite a bit of confusion around all the terms in this space, so let's start with some simple definitions. To put them in context let's first consider how a…


Fixing a broken Firefox session

27th April 2021

In order to stifle my tab-hoarding habits I have recently set my Firefox install to not recover sessions when I restart the browser. This means that every time I turn my computer off for the day it will delete all the random documenation pages and weird links people have sent me over the course of the day so they don't slowly add up. My habit was so bad that I could easily amass some 100-200…


Creating condensed shared libraries (Embedding NimScript pt. 3)

23rd June 2020

In the first part of this article series we looked at why we would potentially want to be able to run NimScript embedded into our Nim programs. In part two we dove a bit deeper and looked at how we could do this embedding, and how we could pass data from the scripts to our native code. In this final article (for now) we’ll look at how we can distribute a program that embeds NimScript,…


How to embed NimScript into a Nim program (Embedding NimScript pt. 2)

31st May 2020

In the first part of this three part article series we looked at why we would want to embed NimScript into our Nim applications. Particularly why we would want to use it for configuration. Whether or not that is your goal, this article will explain how this can be achieved. When I started looking into this I started in the obvious place, Nimble. For those of you not very well versed in the Nim ecosystem,…


Tips and tricks with implicit return in Nim

1st November 2019

One feature in Nim that it shares with several other languages, especially functional ones, is implicit return of values. This is one of those small features that might just seem like a way to avoid writing return everywhere. But in fact it can be used for much more than that! So what is implicit return? In Nim we have three ways to return a value from a procedure, you have the explicit way with return,…