Nim Metaprogramming in the Real World
Originally presented at FOSDEM 2022 Metaprogramming in Nim is very powerful. But why would you use it? How is it used in the real world? We will explore the "power levels": starting from generics, continuing to templates and finally arriving at macros. We will first look at generics usage in VMath (Vector Math Library) and Jsony (JSON Parsing Library). Then we will continue on to templates and how they are used in VMath and Windy. Finally, we will look macros, the top of the "power levels", and how they are used in Shady (a Nim to GLSL compiler) and Genny (Generates bindings for Nim libraries). 0:00 Intro 0:30 Metaprogramming power levels 1:28 Generics 2:23 Using generics in VMath 4:40 Using generics in Jsony 8:20 Templates 10:26 Using templates in VMath 11:43 Using templates in Windy 15:10 Macros 15:22 Using macros in Shady 19:40 Using macros in Genny 20:51 Using Genny to generate bindings 30:18 Closing Links to libraries in this talk: vmath - https://github.com/treeform/vmath jsony - https://github.com/treeform/jsony windy - https://github.com/treeform/windy shady - https://github.com/treeform/shady genny - https://github.com/treeform/genny

"Nim Nuggets: Systems Programming & Metaprogramming Magic" by Aditya Siram

Nim for Pythonistas - Pietro Peterlongo

A Brief Introduction to Nim

Nim on everything From microcontrollers to web-sites, C and JS as intermediary languages

Introduction to Native Extensions • May 2026 Edmonton JavaScript, Python, Ruby Meetup

Optimising for Humans - Nim meta-programming for 0-cost abstraction on microcontrollers

Jaremy Creechley: Nim in an RTOS World (NimConf 2021)

The details of JPEG decoding in Nim
![Nim - First Impression [Programming Languages Episode 12]](https://i.ytimg.com/vi/m0KlXID0X28/hqdefault.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLA1JsaFgNu8Tepn-hNxOSSnWdYiPA)
Nim - First Impression [Programming Languages Episode 12]

PolyConf 16: Nim async voodoo / Andreas Rumpf

Interview with Nim language creator Andreas Rumpf

All Rust features explained

King of the "New" Programming Languages?

"We Really Don't Know How to Compute!" - Gerald Sussman (2011)

C++ as Assembly 2.0 - Hello Nim - Viktor Kirilov - code::dive 2019

Dominik Picheta: An intro to Nim for the uninitiated (NimConf 2020)

"Outperforming Imperative with Pure Functional Languages" by Richard Feldman

functional programming with nim language

Metaprogramming with Nim
![Nim - First natively compiled language w/ hot code-reloading at runtime - Viktor Kirilov [ACCU 2019]](https://i.ytimg.com/vi/7WgCt0Wooeo/hqdefault.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLDMtBpWIXs4HCXuoIVEek2h9WuDyg)
