I'm currently writing a compiler for deep learning with both AOT (emitting Nim code) and hopefully later JIT (emitting LLVM IR) capabilities complete with SIMD support. I don't see how I could do that in another language.
My biggest successes:
- include a quite maintainable JIT for x86_64 (compared to asmjit and xbyak I don't need to parse or codegen the C++ code): https://github.com/numforge/laser/blob/master/laser/photon_j...
- a DSL for neural network: https://github.com/mratsim/Arraymancer#sequence-classificati...
- a matrix multiplication BLAS written from scratch competitive with OpenBLAS and MKL on select matrix shape (2000x2000) but that can also support int8/int16/int32/int64 and not just float32/float64 thanks to metaprogramming. Expanding to new SIMD architecture (ARM) is very easy:
--> benchmark: https://github.com/numforge/laser/blob/master/benchmarks/gem...
--> Metaprogramming AVX512 support: https://github.com/numforge/laser/blob/master/laser/primitiv...
The most important thing for me for metaprogramming is being able to operate on the AST directly