[nim-dev] Re: Code generation from AST with annotations in Nim like in C

  • From: Krux02 <arne.doering@xxxxxxx>
  • To: nim-dev@xxxxxxxxxxxxx
  • Date: Tue, 6 Dec 2016 18:46:07 +0000

when you want to have play around with the type system, feel free, if you want 
to have a matrix vector library, I can recommend you to use `this library 
<https://github.com/stavenko/nim-glm>`_. It aims to be something like the c++ 
library glm. 

The original Glm tries to port GLSL to c++, and this libraries tries to do the 
same. Nim is just a bit more flexible with the syntax, and I can say that 
swizzling is supported. But be aware the library while being 100% usable and 
solid does not all the features that glm offers, but almost everything from 
GLSL that is portable to nim (functions, type aliases but no texture 
rasterization).

A bit of history to nim-glm that I think is worth metioning:

Initially I used the library for my own project, but it was not very well 
tested, and had some design issues. Initially that was ok, because it got me 
quickly to the point to be productive, but over time the problems became bigger 
and bigger and  the original codebase was almost impossible to improve on 
(string based code generation). So in a cloak-and-dagger operation I rewrote 
almost the entire codebase to use generics instead of macros, and I added a lot 
of missing functionality. Nim-glm still does not have any test coverage that is 
worth mentioning, but it is used in my projects, and therefore much less likely 
to be wrong in the implementation. The original author accepted that pull 
request, but also stated that his is in little interest to maintain that 
library in the future. The good side is, I will support that library. Maybe at 
some point it is better to clone from my github repository, but not yet, I push 
crap that doesn't compile on the master branch.



It is not entirely there yet, for example there are no spline support.

Other related posts: