Found on Medium: Why we chose the D Language and vibe.d

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Dec 19 21:27:20 UTC 2018


On Wed, Dec 19, 2018 at 09:01:36PM +0000, jmh530 via Digitalmars-d wrote:
> On Wednesday, 19 December 2018 at 17:42:00 UTC, H. S. Teoh wrote:
> > [snip]
> > I'm quite tempted to cook up my own HTML generation framework that
> > does codegen as a separate step, using D tools to generate D code,
> > that then gets compiled into the actual executable.  Despite all the
> > power of CTFE and other compile-time features, past a certain level
> > of complexity I really want to physically see the generated code
> > rather than wade through inscrutable templates and mixins and try to
> > imagine in my head what the generated code looks like.
[...]
> What you really need is a tool that will show you the generated code
> from mixins/templates/ctfe for testing purposes. I don't think you're
> the only one...

That would certainly be a useful feature... but OTOH having actual
codegen outside the compiler gives more flexibility, such as reading (an
arbitrary number of) arbitrary data files, performing arbitrarily
expensive operations on said data, and emitting code based on said data
-- *and* only doing this when the data actually changes, rather than
once every compilation, which would quickly become unfeasibly slow, esp.
with today's CTFE performance.


T

-- 
The richest man is not he who has the most, but he who needs the least.


More information about the Digitalmars-d mailing list