BLADE 0.2Alpha: Vector operations with mixins, expression templates, and asm

Don Clugston dac at nospam.com.au
Thu Apr 5 13:23:20 PDT 2007


Walter Bright wrote:
> David B. Held wrote:
>> Don Clugston wrote:
>>> [...]
>>> But with the proposed changes to 'const', macros, and previous 
>>> discussion about whether tuples should be automatically flattened, I 
>>> have doubts over how stable that part of the language is. I wouldn't 
>>> want to write something that didn't compile any more, or looked 
>>> hopelessly obsolete by the time it was published.
>>> I've been bitten before -- CTFE blasted almost all of my previous 
>>> metaprogramming code into the stone age <g>. What's the shelf life of 
>>> this stuff?.
>>
>> Well, hopefully, if Walter breaks your code again, it will be to make 
>> it even more elegant (although, that will be a bit of a trick, I 
>> admit). Eventually, the language will be so powerful that you can't 
>> make your code any more compact, and then you won't have to worry 
>> about it getting broken.  To be honest, I'd like to see an article 
>> about this in CUJ.  I don't know if they would publish it or not, but 
>> if they did, I guarantee it would make more than a few people take a 
>> hard look at D.
> 
> I'm pretty sure DDJ would publish it, and it would reach a much wider 
> audience than CUJ, which has disappeared <g>.
> 
> Anyhow, Don, this kind of stuff needs to reach a much wider audience 
> than a random posting in this n.g. would get.

Ooooooh....
I just updated the code, adding a code generator for D code, for when 
x87 is unavailable. I could not believe how easy it was. It was about 30 
lines of trivial code. Yet directly generating a 'for' loop is still 
better than what Blitz++ does.
I reckon it'd take less than a week to implement everything those 
libraries do.

The language synergy of tuples, mixins, CTFE, builtin strings, the ~ 
operator, constant folding, array slicing, template string parameters, 
type deduction, defined inline asm, static if, is() expressions... is 
astonishing. *All* of them are required in order for this to work.



More information about the Digitalmars-d mailing list