We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Nim Metaprogramming in the real world

Formal Metadata

Title
Nim Metaprogramming in the real world
Title of Series
Number of Parts
287
Author
Contributors
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
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).