What library functionality would you most like to see in D?

Jacob Carlborg doob at me.com
Mon Aug 1 01:12:17 PDT 2011


On 2011-08-01 03:56, Jonathan M Davis wrote:
> If we do a hand-written lexer of D for Phobos, it really should be a fairly
> direct port of the dmd front-end. It should be _somewhat_ D-ified as
> appropriate, (and the API should definitely be properly range-based and all
> that), but the implementation needs to be fairly close to dmd itself so that
> it's easy for someone to port changes and fixes back and forth between the two.
> Otherwise, they're going to get out of sync fairly easily. If we're not going
> to do a direct port, then we might as well just do the template-based lexer
> generator that Andrei and others would really like to see (which we should
> still do, but I think that the hand-written lexer is nowhere near as valuable
> if it's not a direct port of dmd's lexer).

In the long run I hope that this won't be necessary, I'm hoping that DMD 
will use the lexer from Phobos.

> Also, I see _zero_ value in making it support D1. If it's for D2's standard
> library, then what's the point of it lexing D1? That just complicates the
> lexer for what is essentially a legacy product. And given that the differences
> between D1 and D2 in dmd's lexer are covered with #ifdefs, it would be rather
> complicated to try and do a direct port which covers both D1 and D2. It would
> probably be easier if the two were completely separate.
>
> As for what I've done so far, I'd have to go look. I haven't touched it in a
> couple of months, I expect. There has been a lot of other stuff that I've
> needed to do, and Andrei was trying to discourage such an implementation the
> last time that I brought it up. So, I haven't exactly been in a rush to get it
> done. I'd like to do it, but I've been rather busy.

In this case I really don't think that you should listen to Andrei.

> So, if you really want to work on a potential D lexer for Phobos, that's fine,
> but I really think that it needs to be a rather direct port, and that doesn't
> sound like what you've been doing.
>
> - Jonathan M Davis


-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list