Re: Data-Oriented Demo: SOA, composition via crazy 'using'

2015-01-22 Thread bearophile via Digitalmars-d

Fool:


Jonathan Blow published another video [1] presenting the
progress of his language. He is treating two main topics:

 - a keyword preliminary called 'using' which seems to be quite
close to 'alias this';
 - an annotation SOA for pointers and arrays which allow high
level treatment of structures of arrays;

Jonathan does not seem to be aware of 'alias this' in D.


In D there is also the under-used with() statement. You can 
sometimes replace his using with with in D.


Regarding his SOA and AOS annotations for pointers, arrays and 
_structures_, they are nice. Adding a SOA array in 
std.collections seems a good idea (but it can't cover all usages 
of his SOA and AOS keywords). (But I'd like some performance 
benchmarks that show the advantages of those things in practice).


See also:
http://www.reddit.com/r/rust/comments/2t6xqz/jai_demo_dataoriented_features_soa_crazy_using/

Bye,
bearophile


Re: Data-Oriented Demo: SOA, composition via crazy 'using'

2015-01-22 Thread Justin Whear via Digitalmars-d
On Thu, 22 Jan 2015 21:04:04 +, Kiith-Sa wrote:

 Could you put this up on GitHub/dub? Even if simple this could be very
 useful.

Added some features and a dynamic array implementation, put it up here:
https://github.com/economicmodeling/soa


Re: Data-Oriented Demo: SOA, composition via crazy 'using'

2015-01-22 Thread Justin Whear via Digitalmars-d
On Thu, 22 Jan 2015 18:03:31 +, Justin Whear wrote:

 On Thu, 22 Jan 2015 17:40:17 +, Justin Whear wrote:
 
 I just whacked this out in D: http://dpaste.dzfl.pl/90d96cf05792
 
 Remembered the allMembers trait, using a pointer to parent, etc: http://
 dpaste.dzfl.pl/6fd66ae9b767

OK, I'm done now. 
100% better: http://dpaste.dzfl.pl/4ac987a0fc5a


Re: Data-Oriented Demo: SOA, composition via crazy 'using'

2015-01-22 Thread Justin Whear via Digitalmars-d
On Thu, 22 Jan 2015 17:40:17 +, Justin Whear wrote:

 I just whacked this out in D: http://dpaste.dzfl.pl/90d96cf05792

Remembered the allMembers trait, using a pointer to parent, etc: http://
dpaste.dzfl.pl/6fd66ae9b767


Re: Data-Oriented Demo: SOA, composition via crazy 'using'

2015-01-22 Thread Justin Whear via Digitalmars-d
On Wed, 21 Jan 2015 19:12:20 +, Fool wrote:

 Jonathan Blow published another video [1] presenting the progress of his
 language. He is treating two main topics:
 
   - a keyword preliminary called 'using' which seems to be quite
 close to 'alias this';
   - an annotation SOA for pointers and arrays which allow high
 level treatment of structures of arrays;
 
 Jonathan does not seem to be aware of 'alias this' in D.

I just whacked this out in D: http://dpaste.dzfl.pl/90d96cf05792

The string mixin for the members is only necessary because there's no 
other way to initialize the arrays (can't use parameterless constructor, 
no init() function, etc.)


Re: Data-Oriented Demo: SOA, composition via crazy 'using'

2015-01-22 Thread Kiith-Sa via Digitalmars-d

On Thursday, 22 January 2015 at 19:28:13 UTC, Justin Whear wrote:

On Thu, 22 Jan 2015 18:03:31 +, Justin Whear wrote:


On Thu, 22 Jan 2015 17:40:17 +, Justin Whear wrote:

I just whacked this out in D: 
http://dpaste.dzfl.pl/90d96cf05792


Remembered the allMembers trait, using a pointer to parent, 
etc: http://

dpaste.dzfl.pl/6fd66ae9b767


OK, I'm done now.
100% better: http://dpaste.dzfl.pl/4ac987a0fc5a


Could you put this up on GitHub/dub? Even if simple this could be 
very useful.


Data-Oriented Demo: SOA, composition via crazy 'using'

2015-01-21 Thread Fool via Digitalmars-d
Jonathan Blow published another video [1] presenting the progress 
of his language. He is treating two main topics:


 - a keyword preliminary called 'using' which seems to be quite 
close to 'alias this';
 - an annotation SOA for pointers and arrays which allow high 
level treatment of structures of arrays;


Jonathan does not seem to be aware of 'alias this' in D.

--

[1] https://www.youtube.com/watch?v=ZHqFrNyLlpA

[2] 
https://www.reddit.com/r/programming/comments/2t5ikw/jai_demo_dataoriented_features_soa_crazy_using/


Re: Data-Oriented Demo: SOA, composition via crazy 'using'

2015-01-21 Thread Max Klyga via Digitalmars-d

On 2015-01-21 19:12:20 +, Fool said:

Jonathan Blow published another video [1] presenting the progress of 
his language. He is treating two main topics:


  - a keyword preliminary called 'using' which seems to be quite close 
to 'alias this';
  - an annotation SOA for pointers and arrays which allow high level 
treatment of structures of arrays;


Jonathan does not seem to be aware of 'alias this' in D.


This is a very good video demonstrating the power that 'alias this' 
gives to people that really want to controll object layout and manage 
details of memory access patterns.


AoS and SoA annotations are interesting. This should be easily 
replicatable with the power of D's templates except for the 
'robustness' part of his talk, as you would have to change declarations 
at invocation part to switch AoS to SoA and back.


The material in his talk would make a great blog post demostrating 
power of 'alias this'




Re: Data-Oriented Demo: SOA, composition via crazy 'using'

2015-01-21 Thread thedeemon via Digitalmars-d

On Wednesday, 21 January 2015 at 19:12:21 UTC, Fool wrote:
 - a keyword preliminary called 'using' which seems to be quite 
close to 'alias this';


By the way, what's the current status with multiple `alias this`?