Writing a (dis-)assembler for 8-bit code in D - blog posts
Brian
bcallah at openbsd.org
Tue Apr 20 15:32:37 UTC 2021
On Tuesday, 20 April 2021 at 14:52:08 UTC, Petar Kirov
[ZombineDev] wrote:
> You can almost do what you want, which may be sufficient for
> your needs :P
>
> Have a look these two projects as general examples:
> * https://github.com/PhilippeSigaud/Pegged
> * https://vibed.org/docs#html-templates
>
> Basically, you can embed a DSL with arbitrary syntax and
> semantics in a D program, just as long as the DSL code is
> encapsulated in a string mixin. So, you can either have every D
> file be just a big string mixin - `mixin(myDSL("<lots of code
> here>"))` (see Pegged), or you can put the DSL code as separate
> files and then string-import it at compile-time from the rest
> of the D code (see vibe.d).
Oh, that was definitely tongue-in-cheek to the point of being
obnoxious on my part :)
I was amused that the mixins page specifically called out that
specific potential as monkey business. But I appreciate the links.
~Brian
More information about the Digitalmars-d
mailing list