Agreed. But it would be splendid to have such a thing in Phobos! I'm an expert on curious perversions, and this is a marvelous example of one. being able to compile and run code at run-time will allow to easily wrote heuristically reflective algorithms.
On Thu, Sep 29, 2011 at 1:57 AM, Nick Sabalausky <[email protected]> wrote: > "Gor Gyolchanyan" <[email protected]> wrote in message > news:[email protected]... >> I'd gladly help you with this. I'm very excited to have a parser in >> Phobos! >> > > I was actually thinking more just the lexer. I'd probably let someone else > do the parser. My parsing experience is mostly limited to LALR, and to parse > D it would take a fairly advanced LALR engine to do it properly. So LL may > be better. Plus, DMD already uses LL. > > Keep in mind, too, that even with both a lexer and parser, that still > wouldn't get you very close to being able to actually compile D from within > D (although you can kind of already do that: system("rdmd main.d"); ), > because the lexing and parsing are the easy parts (relatively spaking). The > hard part is all the post-parsing stuff: sematics, typesystem, CTFE, > templates, etc. > > >
