3 ms·
In D with D "mixins": https://github.com/m3m0ry/drainfuck https://github.com/m3m0ry/drainfuck
by hr0m 7y ago
In D with D "mixins": https://github.com/m3m0ry/drainfuck https://github.com/m3m0ry/drainfuck
- Doxin 7y agoYou might be better off linking directly to the source code: https://github.com/m3m0ry/drainfuck/blob/master/source/app.d https://github.com/m3m0ry/drainfuck/blob/master/source/app.d For people unfamiliar with D, a mixin is essentially equivalent to compile-time eval. you call mixin() with a string, that call then gets replaced with that string compiled as D code. Combine that with the fact that you can run arbitrary code at compile time in D and you get brainfuck-as-a-DSL in 27 lines of code.