CTFE ^^ (pow)

Nick Sabalausky (Abscissa) SeeWebsiteToContactMe at semitwist.com
Sat Mar 24 05:04:57 UTC 2018


On 03/23/2018 02:09 PM, Manu wrote:
> If I have to continue to generate
> tables offline and paste big tables of data in the source code (and
> then re-generate them manually when I change something); then
> situation is identical to C++, therefore, stick with C++.\
> 

WAT?

When in the world would anyone ever need to do any of that? And I mean 
*regardless* of language? What kind of build system are you even using, 
punch cards and sneakernet?

Just run your custom generator tool from your buildscript (it's a 
trivial one-liner), and have it generate a full-fledged .d file ready 
for import (or a data file which is then string-imported by your main 
program).

It's quick and trivial, I've been doing it for a project written in Haxe 
(and just converted it to C# the other day as part of a big Flash -> 
Unity3D conversion) and it works quick-and-easy even there (of course, 
the Haxe/C#-generating tool is written in D, the tool was just easier to 
write that way).

DMD itself used to do that too when it was still C-based. Nobody ever 
needed to manually re-regenerate it (it was automatically invoked when 
necessary by the makefile), and *certainly* nobody ever needed to go 
copy-pasting any generated data.


More information about the Digitalmars-d mailing list