CTFE thoughts & functional approach

Robert M. Münch via Digitalmars-d digitalmars-d at puremagic.com
Sun Jan 31 05:59:06 PST 2016


I like CTFE and the meta programming idea for languages like D.

However, I'm wondering why most (everyone?) is trying to do 
meta-programming using the same language as the one getting compiled. 
IMO the use-cases a pretty different and doing CTFE, code-generation 
etc. needs some other approach. If you look at all the strange template 
syntax, strange hacks etc. it's all far from being obvious.

Why not have a CTL (compile-time-language) that has access to some 
compiler internals, that follows a more functional concept? We are 
evaluating sequences of things to generate code, include / exclude code 
etc.

>From my experience with the different approaches, functional thinking 
is much better suited and simpler to use for CTFE goals.

IMO that would really be a big step ahead. Because you know a hammer, 
not everything is a nail...

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



More information about the Digitalmars-d mailing list