4 ms·
The usual recommendations have been given. Now for more touristic approach what I would like to use if given excuse and time. All those options are mostly writt
by hawski 4y ago
The usual recommendations have been given. Now for more touristic approach what I would like to use if given excuse and time. All those options are mostly written in C:
- QBE [1] - small compiler backend with nice IL
- DynASM [2] - IIUC the laujit's backend, that can and is used by other languages
- uBPF - Userspace eBPF VM. Depending on your DSL the eBPF toolchain could fit your use-case, but this would probably be the biggest excursion. There is some basic assembler in python.
[1] https://c9x.me/compile/ https://c9x.me/compile/
[2] https://luajit.org/dynasm.html https://luajit.org/dynasm.html
[3] https://github.com/iovisor/ubpf https://github.com/iovisor/ubpf
- adinisom 4y agoCan second the DynASM recommendation. I've used it -- was stupid easy to use. Gives your C code an in-line assembler that works at runtime to generate a function pointer.