Make dub part of the standard dmd distribution

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 2 02:32:28 PDT 2015


On Tue, 02 Jun 2015 21:12:14 +1200, Rikki Cattermole wrote:

> I say wow.
> 
> Okay not really I know it is possible and not all the hard. Personally I
> think it is a rather an awesome possibility.

adding some CTFE functions is not that hard at all. it's not documented, 
but one can look at "import()" and "pragma()" to see how they're doing 
their things and do the same. that's what i did, and it took me one day 
to write a working PoC.

i promised to make a series of articles on that for TWiD, but still 
didn't done that. mea maxima culpa.


> Really what I want is to add the ability to add on the compiler side
> symbols that can be CTFE'd.
> Registered at start of runtime.

i'm afraid i didn't get it. can you provide a sample?


> Add on shared library support and wamo. You can add stuff like this
> pretty arbitrary :)

you mean adding symbols with plugin-like system? i'm not sure that it 
will be easy. anyway, with well-defined CTFE API to access file system 
and execute commands (with restrictions, of course, so D programs will 
not go wild doing "rm -rf ~/" ;-) one can write modules that contains 
functions that acts like "filters", executing external binaries and 
massaging input/output.

with some hooks added (like "call this CTFE function (if it present) when 
module importing fails") and ability to add -I/-J pathes in that hooks 
(restricted to some "library root dir") one can write "CTFE rdmd with 
automatic package downloading".

i think i have to make a draft and PoC for that, so people can try it and 
see how k00l it is. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150602/99784bfb/attachment.sig>


More information about the Digitalmars-d mailing list