A brainfuck parser works now with newCTFE

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 29 18:20:52 PDT 2017


On Sun, Jul 30, 2017 at 01:15:50AM +0000, Stefan Koch via Digitalmars-d wrote:
> Hi Guys,
> 
> I just ran the first moderately complex ctfe function successfully through
> newCTFE!
> 
> This is the code that works now :
> 
> module bf_parser;
[...]
> pragma(msg, parseBf("[,....]")[3].token);
> 
> It has been a year of work to get to this point.
> And it might seem a little trivial.
> 
> But this is actually the a showcase of methods, slices, strings and
> structs interacting.

Very nice indeed!

Out of curiosity, how does the performance of newCTFE compare to the
current CTFE with the above code?  E.g., if you pass in a BF program of
non-trivial length, what's the difference in performance?


T

-- 
Tech-savvy: euphemism for nerdy.


More information about the Digitalmars-d mailing list