[OT] Google techtalk on LLVM 2.0 and cfront

BLS nanali at nospam-wanadoo.fr
Sat Aug 25 10:51:40 PDT 2007


Deewiant schrieb:
> Stephen Waits wrote:
>> Deewiant wrote:
>>> I watched the talk, was inspired, and about an hour later began to write a
>>> D frontend for LLVM, in D. <g>. I'm basing it on the clang source but I'm
>>> writing
>> Tomas Lindquis Olsen has mentioned that he's working on this.  Check out the
>> LLVM thread over in D.gnu entitled "D + LLVM?".
>>
> 
> I know. The difference is that he's using the DMD frontend whereas I'm writing
> one from scratch.
> 
> The idea is that if I don't (read: since I won't) get to the codegen phase any
> time soon, it should at least be usable as a "lint"-like tool for D, providing
> better diagnostics than DMD. Probably also metadata for other tools like IDEs,
> as was mentioned in the talk.
> 

Why reinventing the wheel ?
http://code.google.com/p/dil/
Quote :

dil is a hand-crafted compiler implementation for the D programming 
language. Currently the lexer and the parser are fully implemented 
(except for very minor things.) No semantic analysis is done at the 
moment. The backend will most probably be gcc.

What dil can do at the moment:

     * dil is fully internationalized and can output compiler messages 
in English, German and Turkish. You can determine which language to use 
with a setting in config.d.
     * Generate XML or HTML documents. You can choose to generate tags 
for tokens only or you can also have the whole parse tree unparsed. The 
whitespace of the original source file is preserved. You can view the 
HTML documents in any browser you like. The XML documents can only be 
viewed in W3C-standards compatible browsers(*) in combination with an 
XML formatting CSS document. dil provides two ordinary CSS documents 
(for XML/HTML) which can be customized to one's heart's content. (*Note: 
Internet Explorer is the only browser that spectacularly fails at this 
job.)

     * dil can parse D 2.0 additions:
           o ForeachRangeStatement.
           o Cast expressions: cast(const) and cast(invariant).
           o Type constructors: const(Type) and invariant(Type).
           o Traits expressions: __traits(Identifier) and 
__traits(Identifier, TemplateArguments).
           o const/invariant/final/scope/static as storage classes in 
parameter lists (e.g. void func(final scope Foo f);).
           o invariant as storage class for declarations (e.g. invariant 
Foo f;).

End Quote
HTH Bjoern



More information about the Digitalmars-d mailing list