[dmd-internals] How important are the exact formats of __DATE__, __TIME__, and __TIMESTAMP___?

Jonathan M Davis jmdavisProg at gmx.com
Tue Mar 8 20:52:23 PST 2011


On Tuesday 08 March 2011 20:46:49 Andrei Alexandrescu wrote:
> I understand. If I could, I'd kindly discourage you from working on it.
> Its existence would stifle the impetus to work on general lexing and
> parsing frameworks (a la highly integrated lex/yacc using D's
> generational capabilities). Those in turn would push the compiler
> forward and would help fixing bugs, and would offer the proverbial
> fishing rod (tools for parsing any language) instead of fish (a lexer
> and a parser for D itself).

Well, I fully support a generic lexer, but I also see value in a lexer which 
closely follows what the front end is doing for D. But it's not like I've been 
making huge progress on it and am about to submit it for review. I have too much 
other stuff on my plate to blow through it like that.

Though honestly, if I were to be writing a lexer and/or parser for a compiler of 
any kind, I'd just do it by hand. It's a lot more flexible that way. So, even if 
a solid, generic D lexing tool existed, I'm not sure that I'd use it for 
anything.

In any case, as I understood it, the result of that original discussion was that 
we wanted to have a generic lexing solution (and presumably a corresponding 
parsing solution following that) but that we still want a lexer and parser for D 
which are close to what the C++ front end is doing. So, as requested, I've 
slowly been working on that.

- Jonathan M Davis


More information about the dmd-internals mailing list