D and the world

eao197 eao197 at intervale.ru
Wed Apr 25 13:45:03 PDT 2007


On Thu, 26 Apr 2007 00:12:19 +0400, Jari-Matti Mäkelä  
<jmjmak at utu.fi.invalid> wrote:

> eao197 wrote:
>> On Wed, 25 Apr 2007 23:23:52 +0400, "Jari-Matti Ma"kela""
>>>> (for example it is possible to open and read files in compile-time,
>>
>>> Well, this is possible in D now too.
>>
>> May be I miss something. How to do this in D in compile-time?
>
> It doesn't implement full I/O, but you can do some stuff with import
> expressions. Some operating systems (Plan9) are heavily file oriented so
> it can help a lot. Of course importing regular files is possible in
> other systems too. Was this what you were looking for?

I know about the import expression, but I speak about different kind of  
file processing. For example:
1) open a x.503 certificate file during compilation, checking it and  
importing a public key from it into a program as byte array;
2) open a WSDL file, parsing it and generating stubs or skeletons for the  
described WebService;
and so on.


I think I need to describe my own point of view. There isn't need to  
support such DSL via some special language features (like more powerful  
CTFE or syntax extension). All these tasks can be done by external code  
generation tools and the import expression is enough.

But external code generation has its own drawbacks. It needs external  
software installed, it cannot be used in foreign compile farms (or usage  
may be limited), it needs more advanced build tools.

However there are other kinds of DSL which require more advanced CTFE and,  
may be, some macro system (like samples from Don Clugston).

At now I just want to understand what kinds of DSL can be handled by  
different techniques (CTFE and mixins, macros, external code generation  
and so on).

-- 
Regards,
Yauheni Akhotnikau



More information about the Digitalmars-d mailing list