4 ms·
I once (ab)used this approach to express x86 assembly directly in C++: https://github.com/mattbierner/Template-Assembly https://github.com/mattbierner/Template-
by mattbierner 9y ago
I once (ab)used this approach to express x86 assembly directly in C++: https://github.com/mattbierner/Template-Assembly https://github.com/mattbierner/Template-Assembly The library uses standard C++ syntax to build up complex templated types that represent the assembly code. These types are then passed through a simple templated "assembler" at compile time, which spits out a c string of machine code which you can invoke at runtime.
Now if only someone would write a compiletime C compiler in C++ templates...