newCTFE: perliminary delegate support is in!
Stefan Koch
uplink.coder at googlemail.com
Wed Jun 13 06:28:44 UTC 2018
On Wednesday, 13 June 2018 at 06:10:26 UTC, Cym13 wrote:
>
> That's very nice! Out of curiosity, what was the reason to
> avoid a conventional stack? Or was it a consequence more than a
> design decision? (If you've explained it before, feel free to
> just throw the old post at me)
It was an initial design decision. (I addressed it briefly in my
2017 talk on newCTFE)
https://www.youtube.com/watch?v=crHnumzsLUs&t=2420
The main reason was to avoid the debugging nightmare that messing
with the stack-pointer causes. I thought the most effective way
to not have this problem was to simply eliminate the stack
pointer.
Another reason is that I am noticing a tendency in real hardware
to have multiple-stacked versions of the register set. Doing the
same with my virtual cpu would be forward compatible :)
All in all I do not regret that decision at all.
It doubtlessly saved weeks of debugging!
(And harmonizes delegates with closures (since in newCTFE _all_
delegates have to be closures.))
Cheers,
Stefan
More information about the Digitalmars-d
mailing list