Proposal: static template(fail)
Bruce Adams
tortoise_74 at yeah.who.co.uk
Mon Dec 17 13:14:41 PST 2007
On Mon, 17 Dec 2007 18:53:49 -0000, BCS <ao at pathlink.com> wrote:
> Reply to Bruce,
>
>> On Fri, 14 Dec 2007 20:01:17 -0000, BCS <ao at pathlink.com> wrote:
>>>
>> Prolog is entirely based on backtracking huge numbers of predicates
>> and it doesn't run that slowly. I don't think it would be much of a
>> problem in D unless you write a huge number of really complex evil
>> templates and stick them all in one module.
>> I'm not sure even the legendary obfuscator Downs could stretch it to
>> breaking point.
>> Mr. Blade library might come closer. Anyway, as with any language
>> feature you should only pay for it if you use it. Unless you are
>> overusing it, it shouldn't be a problem.
>
> take a look at scrapple.backmath, the bulk of it is a huge list of
> static ifs inside templates. The way it's set up now it doesn't do any
> backtracking, but I rather dislike the brut force approach it is taking
> ("is this xyzzy? No? how about xyzzY? No? How about...[next 100 lines
> skipped]") The way code seems to go, new stuff will get layered on top
> of old stuff. Add backtracking into the mix as part of the language and
> soon D will get a rep of "yah it's good, but I can wright, debug,
> compile and be done faster in C than I can compile in D".
>
That is only the case if it is a programming style that is encouraged or
frequently required. If it is for something that occurs rarely and is
discouraged only bad programs will be tangled and bad programs will always
be tangled. Is it really likely to occur often? and is there a better
solution
or workaround?
More information about the Digitalmars-d
mailing list