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,…
[youtube BdQkU_HepIg]
Over the past couple of years I’ve been playing around with creating my own WM. I recently picked up the project again, and I quickly realised that it was time to re-do the configuration system. Up until this point I had been using a TOML file for the configuration. But it was proving a bit clumsy to use, and I found myself using lots of strings with custom formatted content for doing more complex…
Recently I got made aware that a comment I made on HackerNews had been linked to in a ZDNet article, this made me realise I should probably feature in here as well. So in a similar fashion to my older post that was a Reddit reply, here is my entire reply with only formatting changes, keep in mind that some of the replies might be outdated:
Who started this?
That would…
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
,…
One thing I've mentioned about metaprogramming in Nim, both in posts on this site and in talks, is that metaprogramming in Nim can enhance read- and maintainability. Opponents of metaprogramming would probably sneer at that and remark that it's quite the opposite. And sure, metaprogramming is a powerful tool, and with any sufficiently powerful tool you have to be careful. The same way a chainsaw can take your leg off if you're not careful, a…