On 2018-07-28 15:43:12 +0000, rikki cattermole said:

    * Could I somehow call an external program during compilation which gets the DSL block as input and returns D code?

No. But you can pre-process.

Yes, sure, but this complicates the build-system. I preferr to use as few parts as possible.


    * Is it possible to populate such a dictonary via CTFE?

Sort of, it can be registered, but the actual execution of the registration occurs at runtime.

Yes, no problem. How is this done?

But you're slightly over thinking this. Write an interpreter and a parser. The fact that the parser can work at CTFE is irrelevant and almost a footnote on the page of details ;).

Not really if you think about deployment. I want to create a single executable, no external files. So I somehow have to get the scripts included or use the compiler as generator. The main use-case is, that I want to use a very declarative approach for some UI parts.

If you want to be clever you could generate D code and mix it in based upon what was parsed. But you'd still want that dictionary.

Yes, mixing in generate D code was the idea. However, I think a good included infrastructure that support creating DSLs might help a lot to simplify this.


--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster

Reply via email to