On Monday 01 August 2011 10:12:17 Jacob Carlborg wrote: > 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.
Well, when I have multiple things on my plate, and Andrei has a major disagreement with one, I'm less likely to focus on that one. It's also one which takes quite a bit of time and focus, whereas there is other stuff which I can do in smaller chunks of time without needing as much focus. So, I haven't worked on it as much. I should probably remedy that, but there's quite a lot that I've been trying to get done. So, yes. I intend to do it in spite of Andrei's opinion on the matter, but lately I've been focusing on other stuff which needs doing. - Jonathan M Davis