digitalmars.D - A little Py Vs C++
- bearophile (8/8) Oct 31 2012 Maybe this Reddit thread should be completed with a nice D
- Peter Alexander (11/12) Nov 01 2012 It's unfortunate that there's still bad press circulating about a
- Paulo Pinto (7/20) Nov 01 2012 I have to agree having to deal with lots of concepts.
- Walter Bright (3/4) Nov 01 2012 Most of them are also well established in one form or another, with prov...
- H. S. Teoh (17/31) Nov 01 2012 I don't see it as a problem, unless one is a programmer of the drone
- Paulo Pinto (6/47) Nov 01 2012 It is not the unwillingness to learn, rather the standard HR way
- Rob T (19/22) Nov 01 2012 I'll second that!
- H. S. Teoh (13/38) Nov 01 2012 Ali's D book might be helpful: http://ddili.org/ders/d.en/index.html
- Rob T (8/13) Nov 01 2012 I never noticed that link before. When I click on it, I go to
- Jesse Phillips (7/20) Nov 01 2012 All the documentation is written in DDoc. The website is hosted
- Tavi Cacina (5/12) Nov 01 2012 Workaround: I find it useful to check the code of a 'std' module
- bearophile (8/11) Nov 01 2012 It's almost impossible to keep languages simple. Some complexity
- Walter Bright (8/10) Nov 01 2012 What about all your feature requests? I think you've made more than anyo...
- Jacob Carlborg (9/16) Nov 02 2012 This is quite interesting. Manu comes in from basically nowhere and
- Don Clugston (7/26) Nov 02 2012 He just knows how to convince Walter.
- Jens Mueller (5/28) Nov 02 2012 I think there are lots of issues in the bug tracker which describe real
- Don Clugston (3/31) Nov 02 2012 The SIMD stuff has no workarounds. I don't know of many other feature
- Jens Mueller (6/40) Nov 02 2012 Then I have a serious misunderstanding.
- Peter Alexander (13/18) Nov 02 2012 It works fine for large vectors. For small vectors, it is
- Jens Mueller (5/25) Nov 02 2012 I see. But can't the alignment problem be solved by using align. Then
- Don Clugston (3/27) Nov 02 2012 No. For SIMD, you cannot afford to have even a single machine
- Jens Mueller (10/39) Nov 02 2012 But the compiler knows about the alignment, doesn't it?
- Kapps (27/39) Nov 02 2012 Note: My knowledge of SIMD/SSE is fairly limited, and may be
- Dejan Lekic (10/44) Nov 02 2012 How do you think people came up with those bug reports? By some
- Jacob Carlborg (7/15) Nov 02 2012 Good point. When you do put the whole real life program in the bug
- Jacob Carlborg (7/10) Nov 02 2012 I know, I know. It's be brought up before and without any more detailed
- Jens Mueller (11/31) Nov 02 2012 I had the same thought when reading this. Very disappointing. An issue
- Don Clugston (5/35) Nov 02 2012 Not for short vectors. They are more like the builtin operations in
- Jens Mueller (7/44) Nov 02 2012 Okay. For me they look the same. Can you elaborate, please? Assume I
- Paulo Pinto (3/65) Nov 02 2012 The auto vectorization code in Visual Studio 2012 seems to work
- Walter Bright (43/48) Nov 02 2012 Another excellent question.
- Manu (17/68) Nov 02 2012 Well, I wouldn't claim any credit for the approach ;) .. I think this is
- Jens Mueller (6/75) Nov 02 2012 I see. Thanks for clarifying.
- Walter Bright (3/6) Nov 02 2012 At the moment, yes.
- Manu (14/20) Nov 03 2012 I think a better quote would be "If i want *HARDWARE* vector
- Jens Mueller (5/32) Nov 03 2012 Cool.
- Simen Kjaeraas (7/22) Nov 03 2012 Perhaps I'm the confused one here, but as I understand it, that's the
- Jens Mueller (3/27) Nov 03 2012 Sorry. I'm the one being confused. You're right Simen.
- Walter Bright (11/13) Nov 02 2012 It's a very fair question.
- Walter Bright (4/5) Nov 02 2012 I want to give a shoutout here for Rainer Schuetze who has been a big he...
- Andrej Mitrovic (6/11) Nov 02 2012 Wow that's really cool!
- Walter Bright (5/9) Nov 02 2012 Thanks, any help would be appreciated. I'll ask Manu for a list of his p...
- Andrei Alexandrescu (5/19) Nov 02 2012 I should add that I'm also totally behind this. When Walter jumped into
- deadalnix (2/24) Nov 02 2012 I still don't understand the benefice over align(16) float[4] .
- Regan Heath (15/44) Nov 02 2012 x
- Manu (8/37) Nov 02 2012 s
- Jacob Carlborg (7/10) Nov 02 2012 I can absolutely understand why he did it but it would be really nice if...
- deadalnix (2/10) Nov 02 2012 I couldn't agree more.
- mist (3/13) Nov 02 2012 So true. Strong mid-term vision of rationales of main language
- deadalnix (2/15) Nov 02 2012 Yeah, and avoid noise and help people concentrate on main points.
- Walter Bright (3/6) Nov 02 2012 I apologize for being circumspect about this, but I have to respect peop...
- Manu (5/15) Nov 02 2012 That said, I think we'd perhaps appreciate that it doesn't appear all ov...
- Jacob Carlborg (12/15) Nov 02 2012 This has nothing to do with what Manu does for a living (sure,
- jerro (5/13) Nov 02 2012 SIMD support was discussed here at length in the days before it
- Jacob Carlborg (5/7) Nov 02 2012 Yeah, I know it's been talked about and discussed, but it's the final
- Jens Mueller (4/12) Nov 02 2012 There is no need to reveal anything private just because you have a road
- Manu (5/13) Nov 02 2012 This is probably my fault, and a matter of corporate transparency. We
- Jacob Carlborg (6/10) Nov 02 2012 This has nothing to do with corporate transparency. It has to do with
- Jens Mueller (3/26) Nov 02 2012 looks different.
- Jacob Carlborg (5/16) Nov 02 2012 I can absolutely see the point in this. Thanks for taking the time and
- Manu (4/17) Nov 02 2012 Hey cheers man! :)
- Jens Mueller (8/26) Nov 02 2012 Now I can understand why you made these decisions. It makes sense to me.
- Timon Gehr (6/25) Nov 02 2012 SIMD support is necessary and the fix for 8108 is very simple. If the
- Manu (38/68) Nov 02 2012 Uh oh, I just caught wind of this thread! ;)
- Andrei Alexandrescu (16/26) Nov 02 2012 I'd argue this actually is part of a category of features that does not
- Dejan Lekic (7/20) Nov 02 2012 I think that is the case of any multi-paradigm language. It is
Maybe this Reddit thread should be completed with a nice D version :-) http://www.reddit.com/r/programming/comments/12ecq5/c11_and_boost_succinct_like_python/ The thread contains some sad comments: http://www.reddit.com/r/programming/comments/12ecq5/c11_and_boost_succinct_like_python/c6uihbi http://www.reddit.com/r/programming/comments/12ecq5/c11_and_boost_succinct_like_python/c6ugw8h Bye, bearophile
Oct 31 2012
On Wednesday, 31 October 2012 at 23:04:15 UTC, bearophile wrote:The thread contains some sad comments:It's unfortunate that there's still bad press circulating about a situation that is long gone. I suppose you just have to try and ignore those people. A more interesting comment is this one: "But the real problem here is that in order to achieve even that, the complexity and amount of concepts you have to deal with in C++11 is mind boggling." The same is true in D. Well-written D code often does look rather elegant, but the amount of understanding needed to write beautiful D code is staggering.
Nov 01 2012
On Thursday, 1 November 2012 at 18:06:21 UTC, Peter Alexander wrote:On Wednesday, 31 October 2012 at 23:04:15 UTC, bearophile wrote:I have to agree having to deal with lots of concepts. On the other hand, except for the programming drones, most D concepts are also available in most mainstream languages. -- PauloThe thread contains some sad comments:It's unfortunate that there's still bad press circulating about a situation that is long gone. I suppose you just have to try and ignore those people. A more interesting comment is this one: "But the real problem here is that in order to achieve even that, the complexity and amount of concepts you have to deal with in C++11 is mind boggling." The same is true in D. Well-written D code often does look rather elegant, but the amount of understanding needed to write beautiful D code is staggering.
Nov 01 2012
On 11/1/2012 12:19 PM, Paulo Pinto wrote:> On the other hand, except for the programming drones, most D concepts are alsoavailable in most mainstream languages.Most of them are also well established in one form or another, with proven value.
Nov 01 2012
On Thu, Nov 01, 2012 at 08:19:56PM +0100, Paulo Pinto wrote:On Thursday, 1 November 2012 at 18:06:21 UTC, Peter Alexander wrote:[...]I don't see it as a problem, unless one is a programmer of the drone persuasion. Many of D's concepts are liberatingly powerful, and very potent in combination.A more interesting comment is this one: "But the real problem here is that in order to achieve even that, the complexity and amount of concepts you have to deal with in C++11 is mind boggling." The same is true in D. Well-written D code often does look rather elegant, but the amount of understanding needed to write beautiful D code is staggering.I have to agree having to deal with lots of concepts.On the other hand, except for the programming drones, most D concepts are also available in most mainstream languages.[...] If we want to minimize the number of concepts, we should program using Lambda calculus. ;-) We already have lambda-syntax for delegates, after all. Now just restrict all statements to only lambda expressions, get rid of difficult concepts like arithmetic operators, variables and imperative programming, and we have a winner on our hands. Seriously, though, imagining that one can program effectively without learning new concepts is a preposterous proposition to me. I just don't understand the unwillingness to learn. T -- Computers shouldn't beep through the keyhole.
Nov 01 2012
On Thursday, 1 November 2012 at 19:44:04 UTC, H. S. Teoh wrote:On Thu, Nov 01, 2012 at 08:19:56PM +0100, Paulo Pinto wrote:It is not the unwillingness to learn, rather the standard HR way of getting replaceable programming drones in most enterprises. This was already discussed a few times. -- PauloOn Thursday, 1 November 2012 at 18:06:21 UTC, Peter Alexander wrote:[...]I don't see it as a problem, unless one is a programmer of the drone persuasion. Many of D's concepts are liberatingly powerful, and very potent in combination.A more interesting comment is this one: "But the real problem here is that in order to achieve even that, the complexity and amount of concepts you have to deal with in C++11 is mind boggling." The same is true in D. Well-written D code often does look rather elegant, but the amount of understanding needed to write beautiful D code is staggering.I have to agree having to deal with lots of concepts.On the other hand, except for the programming drones, most D concepts are also available in most mainstream languages.[...] If we want to minimize the number of concepts, we should program using Lambda calculus. ;-) We already have lambda-syntax for delegates, after all. Now just restrict all statements to only lambda expressions, get rid of difficult concepts like arithmetic operators, variables and imperative programming, and we have a winner on our hands. Seriously, though, imagining that one can program effectively without learning new concepts is a preposterous proposition to me. I just don't understand the unwillingness to learn. T
Nov 01 2012
On Thursday, 1 November 2012 at 18:06:21 UTC, Peter Alexander wrote:The same is true in D. Well-written D code often does look rather elegant, but the amount of understanding needed to write beautiful D code is staggering.I'll second that! I'm finally making good progress with D after a whole lot of effort, and there were (and still are) periods where I felt like giving up, although not so much anymore. The number one missing item that I would love to get my hands on is comprehensive documentaion. What we have now leaves out far too much detail, and may be missing entire features, and what is available is scattered all over the place. Reading the TDPL book is a huge help for understanding D, it's essential reading for sure, but it's only an overview rather than a full text on the subject. The TDPL lacks many of the fine details that one needs to know in order to write proper D code. I find myself experimenting a lot in order to figure out what the various obscure details are, but without comprehensive documentation, I cannot be certain if the observed behaviours are actually correct or fully complete under all situations. --rt
Nov 01 2012
On Thu, Nov 01, 2012 at 08:49:40PM +0100, Rob T wrote:On Thursday, 1 November 2012 at 18:06:21 UTC, Peter Alexander wrote:Ali's D book might be helpful: http://ddili.org/ders/d.en/index.html But yeah, the current documentation needs work. Unfortunately, wishing for it to happen won't make it happen, so if you contribute (use the "improve this page" link) that would be great, and suggestions are also helpful. I recently revised the docs for std.range to explain briefly what ranges are and why we even need them, but this is only one piece of the entire standard library. Many other modules need improved docs. And there is still the need for a general overview to put everything in perspective. T -- It is impossible to make anything foolproof because fools are so ingenious. -- SammyThe same is true in D. Well-written D code often does look rather elegant, but the amount of understanding needed to write beautiful D code is staggering.I'll second that! I'm finally making good progress with D after a whole lot of effort, and there were (and still are) periods where I felt like giving up, although not so much anymore. The number one missing item that I would love to get my hands on is comprehensive documentaion. What we have now leaves out far too much detail, and may be missing entire features, and what is available is scattered all over the place. Reading the TDPL book is a huge help for understanding D, it's essential reading for sure, but it's only an overview rather than a full text on the subject. The TDPL lacks many of the fine details that one needs to know in order to write proper D code. I find myself experimenting a lot in order to figure out what the various obscure details are, but without comprehensive documentation, I cannot be certain if the observed behaviours are actually correct or fully complete under all situations.
Nov 01 2012
On Thursday, 1 November 2012 at 20:10:47 UTC, H. S. Teoh wrote:But yeah, the current documentation needs work. Unfortunately, wishing for it to happen won't make it happen, so if you contribute (use the "improve this page" link) that would be greatI never noticed that link before. When I click on it, I go to github showing me a webpage with "404" on it. The text over link says I need a github account and to submit pull requests. I'm not sure how I'm supposed to make changes with that. I know about the regular Wiki and have made a contribution there, that's very simple to do. --rt
Nov 01 2012
On Thursday, 1 November 2012 at 23:56:00 UTC, Rob T wrote:On Thursday, 1 November 2012 at 20:10:47 UTC, H. S. Teoh wrote:All the documentation is written in DDoc. The website is hosted on github. Github provides an online text editor usable against your repository. Your repository is created as a fork of the original. Github uses pull requests to move changes upstream. It isn't as simple as a wiki but it isn't too bad. Hope that is enough information to get started.But yeah, the current documentation needs work. Unfortunately, wishing for it to happen won't make it happen, so if you contribute (use the "improve this page" link) that would be greatI never noticed that link before. When I click on it, I go to github showing me a webpage with "404" on it. The text over link says I need a github account and to submit pull requests. I'm not sure how I'm supposed to make changes with that. I know about the regular Wiki and have made a contribution there, that's very simple to do. --rt
Nov 01 2012
On Thursday, 1 November 2012 at 19:49:42 UTC, Rob T wrote:On Thursday, 1 November 2012 at 18:06:21 UTC, Peter Alexander wrote:Workaround: I find it useful to check the code of a 'std' module that interests me. A lot of unittests and comments are quite usefull. For ex. about the RAII/ref-counted stuff I checked the stdio.d File.The number one missing item that I would love to get my hands on is comprehensive documentaion. What we have now leaves out far too much detail, and may be missing entire features, and what is available is scattered all over the place.
Nov 01 2012
Peter Alexander:The same is true in D. Well-written D code often does look rather elegant, but the amount of understanding needed to write beautiful D code is staggering.It's almost impossible to keep languages simple. Some complexity comes from the desire to do more and more. As example see this recent request from Manu, it's simple, but it also increases the complexity of D: http://d.puremagic.com/issues/show_bug.cgi?id=8108 Bye, bearophile
Nov 01 2012
On 11/1/2012 2:20 PM, bearophile wrote:Some complexity comes from the desire to do more and more. As example see this recent request from Manu,What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.
Nov 01 2012
On 2012-11-01 23:51, Walter Bright wrote:What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented. Although I think something like AST macros could possible solve issue 8108 and a whole bunch of other features, a few already present in the language. -- /Jacob Carlborg
Nov 02 2012
On 02/11/12 09:07, Jacob Carlborg wrote:On 2012-11-01 23:51, Walter Bright wrote:He just knows how to convince Walter. (Hint: use real-world use cases. Arguments from theoretical computer science carry almost no weight with Walter).What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented.Although I think something like AST macros could possible solve issue 8108 and a whole bunch of other features, a few already present in the language.Yes, and they could cure cancer. "AST macros" can do anything, because they are completely undefined. Without even a vague proposal, it seems like a rather meaningless term.
Nov 02 2012
Don Clugston wrote:On 02/11/12 09:07, Jacob Carlborg wrote:I think there are lots of issues in the bug tracker which describe real use cases. The point is that these are more like bugs whereas Manu's proposals are more like feature requests. JensOn 2012-11-01 23:51, Walter Bright wrote:He just knows how to convince Walter. (Hint: use real-world use cases. Arguments from theoretical computer science carry almost no weight with Walter).What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented.
Nov 02 2012
On 02/11/12 10:12, Jens Mueller wrote:Don Clugston wrote:The SIMD stuff has no workarounds. I don't know of many other feature requests in that category.On 02/11/12 09:07, Jacob Carlborg wrote:I think there are lots of issues in the bug tracker which describe real use cases. The point is that these are more like bugs whereas Manu's proposals are more like feature requests. JensOn 2012-11-01 23:51, Walter Bright wrote:He just knows how to convince Walter. (Hint: use real-world use cases. Arguments from theoretical computer science carry almost no weight with Walter).What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented.
Nov 02 2012
Don Clugston wrote:On 02/11/12 10:12, Jens Mueller wrote:Then I have a serious misunderstanding. I thought D introduced array operations to allow the compiler to generate efficient vector operations (in the long run), i.e. generate SIMD code. Why is this not working out? JensDon Clugston wrote:The SIMD stuff has no workarounds. I don't know of many other feature requests in that category.On 02/11/12 09:07, Jacob Carlborg wrote:I think there are lots of issues in the bug tracker which describe real use cases. The point is that these are more like bugs whereas Manu's proposals are more like feature requests. JensOn 2012-11-01 23:51, Walter Bright wrote:He just knows how to convince Walter. (Hint: use real-world use cases. Arguments from theoretical computer science carry almost no weight with Walter).What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented.
Nov 02 2012
On Friday, 2 November 2012 at 10:24:34 UTC, Jens Mueller wrote:Then I have a serious misunderstanding. I thought D introduced array operations to allow the compiler to generate efficient vector operations (in the long run), i.e. generate SIMD code. Why is this not working out?It works fine for large vectors. For small vectors, it is horrendously slow. The syntax a[] += b[] essentially calls a function which is designed to work for large vectors. It has to determine alignment, load everything from memory, do the operations, then store it back. The SIMD extensions allow you to define variables that are guaranteed to be aligned and will probably be in the right registers to start with. Using them, the vectors ops don't need to determine alignment, and often don't need to do lots of loads/stores. Both have their purposes.
Nov 02 2012
Peter Alexander wrote:On Friday, 2 November 2012 at 10:24:34 UTC, Jens Mueller wrote:I see. But can't the alignment problem be solved by using align. Then have the compiler emits a call that checks for alignment if none was specified else use a faster version. JensThen I have a serious misunderstanding. I thought D introduced array operations to allow the compiler to generate efficient vector operations (in the long run), i.e. generate SIMD code. Why is this not working out?It works fine for large vectors. For small vectors, it is horrendously slow. The syntax a[] += b[] essentially calls a function which is designed to work for large vectors. It has to determine alignment, load everything from memory, do the operations, then store it back. The SIMD extensions allow you to define variables that are guaranteed to be aligned and will probably be in the right registers to start with. Using them, the vectors ops don't need to determine alignment, and often don't need to do lots of loads/stores. Both have their purposes.
Nov 02 2012
On 02/11/12 11:57, Jens Mueller wrote:Peter Alexander wrote:No. For SIMD, you cannot afford to have even a single machine instruction inserted, or the benefit is entirely lost.On Friday, 2 November 2012 at 10:24:34 UTC, Jens Mueller wrote:I see. But can't the alignment problem be solved by using align. Then have the compiler emits a call that checks for alignment if none was specified else use a faster version.Then I have a serious misunderstanding. I thought D introduced array operations to allow the compiler to generate efficient vector operations (in the long run), i.e. generate SIMD code. Why is this not working out?It works fine for large vectors. For small vectors, it is horrendously slow. The syntax a[] += b[] essentially calls a function which is designed to work for large vectors. It has to determine alignment, load everything from memory, do the operations, then store it back. The SIMD extensions allow you to define variables that are guaranteed to be aligned and will probably be in the right registers to start with. Using them, the vectors ops don't need to determine alignment, and often don't need to do lots of loads/stores. Both have their purposes.
Nov 02 2012
Don Clugston wrote:On 02/11/12 11:57, Jens Mueller wrote:But the compiler knows about the alignment, doesn't it? align(16) float[4] a; vs float[4] a; In the former case the compiler can generate better code and it should. The above syntax is not supported. But my point is all the compiler cares about is the alignment which can be specified in the code somehow. Sorry for being stubborn. JensPeter Alexander wrote:No. For SIMD, you cannot afford to have even a single machine instruction inserted, or the benefit is entirely lost.On Friday, 2 November 2012 at 10:24:34 UTC, Jens Mueller wrote:I see. But can't the alignment problem be solved by using align. Then have the compiler emits a call that checks for alignment if none was specified else use a faster version.Then I have a serious misunderstanding. I thought D introduced array operations to allow the compiler to generate efficient vector operations (in the long run), i.e. generate SIMD code. Why is this not working out?It works fine for large vectors. For small vectors, it is horrendously slow. The syntax a[] += b[] essentially calls a function which is designed to work for large vectors. It has to determine alignment, load everything from memory, do the operations, then store it back. The SIMD extensions allow you to define variables that are guaranteed to be aligned and will probably be in the right registers to start with. Using them, the vectors ops don't need to determine alignment, and often don't need to do lots of loads/stores. Both have their purposes.
Nov 02 2012
On Friday, 2 November 2012 at 14:22:34 UTC, Jens Mueller wrote:But the compiler knows about the alignment, doesn't it? align(16) float[4] a; vs float[4] a; In the former case the compiler can generate better code and it should. The above syntax is not supported. But my point is all the compiler cares about is the alignment which can be specified in the code somehow. Sorry for being stubborn. JensNote: My knowledge of SIMD/SSE is fairly limited, and may be somewhat out of date. In other words, some of this may be flat out wrong. First, just because you have something that can have SIMD operations performed on it, doesn't mean you necessarily want to. SSE instructions for example have to store things in the XMM registers, and accessing the actual values of individual elements in the vector is expensive. When using SSE, you want to avoid accessing individual elements as much as possible. Not following this tends to hurt performance quite badly. Yet when you just have a float[4], you may or may not be frequently or infrequently accessing individual elements. The compiler can't know whether you use it as a single SIMD vector more often, or use it to simply store 4 elements more often. You could be aligning it for any reason, so it's not too fair a way of determining it. Secondly, you can't really know which SIMD instructions are supported by your target CPU. It's safe to say SSE2 is supported for pretty much all x86 CPUs at this point, but something like SSE4.2 instructions may not be. Just because the compiler knows that the CPU compiling it supports it doesn't mean that the CPU running the program will have those instructions. Lastly, we'd still need SIMD intrinsics. It may be simple to tell that a float[4] + float[4] operation could use addps, but it would be more difficult to determine when to use something like dotps (dot product across two SIMD vectors), and various other instructions. Not to mention, non-x86 architectures.
Nov 02 2012
On Friday, 2 November 2012 at 08:38:21 UTC, Don Clugston wrote:On 02/11/12 09:07, Jacob Carlborg wrote:How do you think people came up with those bug reports? By some magic? :) You think they did not actually *pull their hair off* trying to figure out why their REAL LIFE program does not work, and when we could not find the reason we naturally started thinking "oh, it might be yet another missing thing in D" or "oh, yet another DMD/phobos/druntime bug!"... Or, another scenario (a very typical one) - after DMD/phobos/druntime is updated, my production application no longer compiles...On 2012-11-01 23:51, Walter Bright wrote:He just knows how to convince Walter. (Hint: use real-world use cases. Arguments from theoretical computer science carry almost no weight with Walter).What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented.Although I think something like AST macros could possible solve issue 8108 and a whole bunch of other features, a few already present in the language.Yes, and they could cure cancer. "AST macros" can do anything, because they are completely undefined. Without even a vague proposal, it seems like a rather meaningless term.
Nov 02 2012
On 2012-11-02 19:03, Dejan Lekic wrote:How do you think people came up with those bug reports? By some magic? :) You think they did not actually *pull their hair off* trying to figure out why their REAL LIFE program does not work, and when we could not find the reason we naturally started thinking "oh, it might be yet another missing thing in D" or "oh, yet another DMD/phobos/druntime bug!"... Or, another scenario (a very typical one) - after DMD/phobos/druntime is updated, my production application no longer compiles...Good point. When you do put the whole real life program in the bug report "it's too big, you need to create a small test case". When you do create a small test case for the feature/bug it's suddenly not "real life" code. -- /Jacob Carlborg
Nov 02 2012
On 2012-11-02 09:38, Don Clugston wrote:Yes, and they could cure cancer. "AST macros" can do anything, because they are completely undefined. Without even a vague proposal, it seems like a rather meaningless term.I know, I know. It's be brought up before and without any more detailed specification/definition is hard to do anything about it. I've done some research in the subject in the hope I can write down something useful that could be a proposal for D, but I don't have anything yet. -- /Jacob Carlborg
Nov 02 2012
Jacob Carlborg wrote:On 2012-11-01 23:51, Walter Bright wrote:I had the same thought when reading this. Very disappointing. An issue with zero votes is fixed instead of more important ones. Why do I vote anyway? Regarding SIMD I have the feeling that because it is built into the compiler static vectors have actually failed what they promised. I thought D proposed a portable way of vector operations such that you write float[4] = a[] + b[] and the compiler generates SIMD code for you. JensWhat about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented. Although I think something like AST macros could possible solve issue 8108 and a whole bunch of other features, a few already present in the language.
Nov 02 2012
On 02/11/12 10:01, Jens Mueller wrote:Jacob Carlborg wrote:Not for short vectors. They are more like the builtin operations in Fortran, ie designed for large vectors. More for scientific kinds of applications than games. (The two applications look superficially similar, but in practice they have little in common).On 2012-11-01 23:51, Walter Bright wrote:I had the same thought when reading this. Very disappointing. An issue with zero votes is fixed instead of more important ones. Why do I vote anyway? Regarding SIMD I have the feeling that because it is built into the compiler static vectors have actually failed what they promised. I thought D proposed a portable way of vector operations such that you write float[4] = a[] + b[] and the compiler generates SIMD code for you.What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented. Although I think something like AST macros could possible solve issue 8108 and a whole bunch of other features, a few already present in the language.
Nov 02 2012
Don Clugston wrote:On 02/11/12 10:01, Jens Mueller wrote:Okay. For me they look the same. Can you elaborate, please? Assume I want to add two float vectors which is common in both games and scientific computing. The only difference is in games their length is usually 3 or 4 whereas in scientific computing they are of arbitrary length. Why do I need instrinsics to support the game setting? JensJacob Carlborg wrote:Not for short vectors. They are more like the builtin operations in Fortran, ie designed for large vectors. More for scientific kinds of applications than games. (The two applications look superficially similar, but in practice they have little in common).On 2012-11-01 23:51, Walter Bright wrote:I had the same thought when reading this. Very disappointing. An issue with zero votes is fixed instead of more important ones. Why do I vote anyway? Regarding SIMD I have the feeling that because it is built into the compiler static vectors have actually failed what they promised. I thought D proposed a portable way of vector operations such that you write float[4] = a[] + b[] and the compiler generates SIMD code for you.What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented. Although I think something like AST macros could possible solve issue 8108 and a whole bunch of other features, a few already present in the language.
Nov 02 2012
On Friday, 2 November 2012 at 10:50:56 UTC, Jens Mueller wrote:Don Clugston wrote:The auto vectorization code in Visual Studio 2012 seems to work pretty well.On 02/11/12 10:01, Jens Mueller wrote:Okay. For me they look the same. Can you elaborate, please? Assume I want to add two float vectors which is common in both games and scientific computing. The only difference is in games their length is usually 3 or 4 whereas in scientific computing they are of arbitrary length. Why do I need instrinsics to support the game setting? JensJacob Carlborg wrote:Not for short vectors. They are more like the builtin operations in Fortran, ie designed for large vectors. More for scientific kinds of applications than games. (The two applications look superficially similar, but in practice they have little in common).On 2012-11-01 23:51, Walter Bright wrote:I had the same thought when reading this. Very disappointing. An issue with zero votes is fixed instead of more important ones. Why do I vote anyway? Regarding SIMD I have the feeling that because it is built into the compiler static vectors have actually failed what they promised. I thought D proposed a portable way of vector operations such that you write float[4] = a[] + b[] and the compiler generates SIMD code for you.What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented. Although I think something like AST macros could possible solve issue 8108 and a whole bunch of other features, a few already present in the language.
Nov 02 2012
On 11/2/2012 3:50 AM, Jens Mueller wrote:Okay. For me they look the same. Can you elaborate, please? Assume I want to add two float vectors which is common in both games and scientific computing. The only difference is in games their length is usually 3 or 4 whereas in scientific computing they are of arbitrary length. Why do I need instrinsics to support the game setting?Another excellent question. Most languages have taken the "auto-vectorization" approach of reverse engineering loops to turn them into high level constructs, and then compiling the code into special SIMD instructions. How to do this is explained in detail in the (rare) book "The Software Vectorization Handbook" by Bik, which I fortunately was able to obtain a copy of. This struck me as a terrible approach, however. It just seemed stupid to try to teach the compiler to reverse engineer low level code into high level code. A better design would be to start with high level code. Hence, the appearance of D vector operations. The trouble with D vector operations, however, is that they are too general purpose. The SIMD instructions are very quirky, and it's easy to unwittingly and silently cause the compiler to generate absolutely terribly slow code. The reasons for that are the alignment requirements, coupled with the SIMD instructions not being orthogonal - some operations work for some types and not for others, in a way that is unintuitive unless you're carefully reading the SIMD specs. Just saying align(16) isn't good enough, as the vector ops work on slices and those slices aren't always aligned. So each one has to check alignment at runtime, which is murder on performance. If a particular vector op for a particular type has no SIMD support, then the compiler has to generate workaround code. This can also have terrible performance consequences. So the user writes vector code, benchmarks it, finds zero improvement, and the reasons why will be elusive to anyone but an expert SIMD programmer. (Auto-vectorizing technology has similar issues, pretty much meaning you won't get fast code out of it unless you've got a habit of examining the assembler output and tweaking as necessary.) Enter Manu, who has a lot of experience making SIMD work for games. His proposal was: 1. Have native SIMD types. This will guarantee alignment, and will guarantee a compile time error for SIMD types that are not supported by the CPU. 2. Have the compiler issue an error for SIMD operations that are not supported by the CPU, rather than silently generating inefficient workaround code. 3. There are all kinds of weird but highly useful SIMD instructions that don't have a straightforward representation in high level code, such as saturated arithmetic. Manu's answer was to expose these instructions via intrinsics, so the user can string them together, be sure that they will generate real SIMD instructions, while the compiler can deal with register allocation. This approach works, is inlineable, generates code as good as hand-built assembler, and is useable by regular programmers. I won't say there aren't better approaches, but this one we know works.
Nov 02 2012
On 2 November 2012 20:02, Walter Bright <newshound2 digitalmars.com> wrote:On 11/2/2012 3:50 AM, Jens Mueller wrote:Well, I wouldn't claim any credit for the approach ;) .. I think this is the standard for maximum performance, and also very well understood. But the thing that excites me most is the potential quality of libraries that can be built on top. D has so much potential to extend on this SIMD foundation with it's templates being able to intelligently handle far more context specific situations. What we do already in other languages will be far more convenient, more portable, and possibly even produce better code in D. And the biggest bonus, it will be readable! :) I think it's a low risk investment, and it doesn't prohibit higher level support in the future. This approach works, is inlineable, generates code as good as hand-builtOkay. For me they look the same. Can you elaborate, please? Assume I want to add two float vectors which is common in both games and scientific computing. The only difference is in games their length is usually 3 or 4 whereas in scientific computing they are of arbitrary length. Why do I need instrinsics to support the game setting?Another excellent question. Most languages have taken the "auto-vectorization" approach of reverse engineering loops to turn them into high level constructs, and then compiling the code into special SIMD instructions. How to do this is explained in detail in the (rare) book "The Software Vectorization Handbook" by Bik, which I fortunately was able to obtain a copy of. This struck me as a terrible approach, however. It just seemed stupid to try to teach the compiler to reverse engineer low level code into high level code. A better design would be to start with high level code. Hence, the appearance of D vector operations. The trouble with D vector operations, however, is that they are too general purpose. The SIMD instructions are very quirky, and it's easy to unwittingly and silently cause the compiler to generate absolutely terribly slow code. The reasons for that are the alignment requirements, coupled with the SIMD instructions not being orthogonal - some operations work for some types and not for others, in a way that is unintuitive unless you're carefully reading the SIMD specs. Just saying align(16) isn't good enough, as the vector ops work on slices and those slices aren't always aligned. So each one has to check alignment at runtime, which is murder on performance. If a particular vector op for a particular type has no SIMD support, then the compiler has to generate workaround code. This can also have terrible performance consequences. So the user writes vector code, benchmarks it, finds zero improvement, and the reasons why will be elusive to anyone but an expert SIMD programmer. (Auto-vectorizing technology has similar issues, pretty much meaning you won't get fast code out of it unless you've got a habit of examining the assembler output and tweaking as necessary.) Enter Manu, who has a lot of experience making SIMD work for games. His proposal was: 1. Have native SIMD types. This will guarantee alignment, and will guarantee a compile time error for SIMD types that are not supported by the CPU. 2. Have the compiler issue an error for SIMD operations that are not supported by the CPU, rather than silently generating inefficient workaround code. 3. There are all kinds of weird but highly useful SIMD instructions that don't have a straightforward representation in high level code, such as saturated arithmetic. Manu's answer was to expose these instructions via intrinsics, so the user can string them together, be sure that they will generate real SIMD instructions, while the compiler can deal with register allocation.assembler, and is useable by regular programmers. I won't say there aren't better approaches, but this one we know works.Aye, and it's relatively un-intrusive too. Some new types and a few intrinsics, build useful libraries on top. It shouldn't have complex side effects, and if offers something that was sorely missing from the language today.
Nov 02 2012
Walter Bright wrote:On 11/2/2012 3:50 AM, Jens Mueller wrote:I see. Thanks for clarifying. If I want fast vector operations I have to use core.simd. The built-in vector operations won't fit the bill. I was of the opinion that a vector operation in D should (at some point) generate vectorized code. JensOkay. For me they look the same. Can you elaborate, please? Assume I want to add two float vectors which is common in both games and scientific computing. The only difference is in games their length is usually 3 or 4 whereas in scientific computing they are of arbitrary length. Why do I need instrinsics to support the game setting?Another excellent question. Most languages have taken the "auto-vectorization" approach of reverse engineering loops to turn them into high level constructs, and then compiling the code into special SIMD instructions. How to do this is explained in detail in the (rare) book "The Software Vectorization Handbook" by Bik, which I fortunately was able to obtain a copy of. This struck me as a terrible approach, however. It just seemed stupid to try to teach the compiler to reverse engineer low level code into high level code. A better design would be to start with high level code. Hence, the appearance of D vector operations. The trouble with D vector operations, however, is that they are too general purpose. The SIMD instructions are very quirky, and it's easy to unwittingly and silently cause the compiler to generate absolutely terribly slow code. The reasons for that are the alignment requirements, coupled with the SIMD instructions not being orthogonal - some operations work for some types and not for others, in a way that is unintuitive unless you're carefully reading the SIMD specs. Just saying align(16) isn't good enough, as the vector ops work on slices and those slices aren't always aligned. So each one has to check alignment at runtime, which is murder on performance. If a particular vector op for a particular type has no SIMD support, then the compiler has to generate workaround code. This can also have terrible performance consequences. So the user writes vector code, benchmarks it, finds zero improvement, and the reasons why will be elusive to anyone but an expert SIMD programmer. (Auto-vectorizing technology has similar issues, pretty much meaning you won't get fast code out of it unless you've got a habit of examining the assembler output and tweaking as necessary.) Enter Manu, who has a lot of experience making SIMD work for games. His proposal was: 1. Have native SIMD types. This will guarantee alignment, and will guarantee a compile time error for SIMD types that are not supported by the CPU. 2. Have the compiler issue an error for SIMD operations that are not supported by the CPU, rather than silently generating inefficient workaround code. 3. There are all kinds of weird but highly useful SIMD instructions that don't have a straightforward representation in high level code, such as saturated arithmetic. Manu's answer was to expose these instructions via intrinsics, so the user can string them together, be sure that they will generate real SIMD instructions, while the compiler can deal with register allocation. This approach works, is inlineable, generates code as good as hand-built assembler, and is useable by regular programmers. I won't say there aren't better approaches, but this one we know works.
Nov 02 2012
On 11/2/2012 3:10 PM, Jens Mueller wrote:I see. Thanks for clarifying. If I want fast vector operations I have to use core.simd. The built-in vector operations won't fit the bill.At the moment, yes. However, Manu is working on developing a higher order layer.
Nov 02 2012
On 3 November 2012 01:41, Walter Bright <newshound2 digitalmars.com> wrote:On 11/2/2012 3:10 PM, Jens Mueller wrote:I think a better quote would be "If i want *HARDWARE* vector operations..."; this is not automatically faster by nature, it requires strict self-control in terms of application, and very careful attention if you want your code to be portable. At the moment, yes.I see. Thanks for clarifying. If I want fast vector operations I have to use core.simd. The built-in vector operations won't fit the bill.However, Manu is working on developing a higher order layer.I have a fork; some people are using it already. It still needs a lot of work though; some compilers missing parts, platforms not supported. That said, it's not an effort to address D's natural vector syntax, the key goal is to provide a hardware SIMD API that is as orthogonal as possible and portable (with confidence it will run reasonably well). I wonder if druntime could be enhanced to use the SIMD stuff though in the functions that perform the natural vector operations, might offer some nice little boosts.
Nov 03 2012
Manu wrote:On 3 November 2012 01:41, Walter Bright <newshound2 digitalmars.com> wrote:Cool. It'll be nice though if D's vector operations could be expressed on top of it. I mean a[] + b[] is so much easier to read. JensOn 11/2/2012 3:10 PM, Jens Mueller wrote:I think a better quote would be "If i want *HARDWARE* vector operations..."; this is not automatically faster by nature, it requires strict self-control in terms of application, and very careful attention if you want your code to be portable. At the moment, yes.I see. Thanks for clarifying. If I want fast vector operations I have to use core.simd. The built-in vector operations won't fit the bill.However, Manu is working on developing a higher order layer.I have a fork; some people are using it already. It still needs a lot of work though; some compilers missing parts, platforms not supported. That said, it's not an effort to address D's natural vector syntax, the key goal is to provide a hardware SIMD API that is as orthogonal as possible and portable (with confidence it will run reasonably well). I wonder if druntime could be enhanced to use the SIMD stuff though in the functions that perform the natural vector operations, might offer some nice little boosts.
Nov 03 2012
On 2012-39-03 12:11, Jens Mueller <jens.k.mueller gmx.de> wrote:Perhaps I'm the confused one here, but as I understand it, that's the whole point of the latter part of the paragraph - array operations are implemented in druntime, and that implementation might benefit from using SIMD instructions. -- SimenI have a fork; some people are using it already. It still needs a lot of work though; some compilers missing parts, platforms not supported. That said, it's not an effort to address D's natural vector syntax, the key goal is to provide a hardware SIMD API that is as orthogonal as possible and portable (with confidence it will run reasonably well). I wonder if druntime could be enhanced to use the SIMD stuff though in the functions that perform the natural vector operations, might offer some nice little boosts.Cool. It'll be nice though if D's vector operations could be expressed on top of it. I mean a[] + b[] is so much easier to read.
Nov 03 2012
Simen Kjaeraas wrote:On 2012-39-03 12:11, Jens Mueller <jens.k.mueller gmx.de> wrote:Sorry. I'm the one being confused. You're right Simen. JensPerhaps I'm the confused one here, but as I understand it, that's the whole point of the latter part of the paragraph - array operations are implemented in druntime, and that implementation might benefit from using SIMD instructions.I have a fork; some people are using it already. It still needs a lot of work though; some compilers missing parts, platforms not supported. That said, it's not an effort to address D's natural vector syntax, the key goal is to provide a hardware SIMD API that is as orthogonal as possible and portable (with confidence it will run reasonably well). I wonder if druntime could be enhanced to use the SIMD stuff though in the functions that perform the natural vector operations, might offer some nice little boosts.Cool. It'll be nice though if D's vector operations could be expressed on top of it. I mean a[] + b[] is so much easier to read.
Nov 03 2012
On 11/2/2012 2:01 AM, Jens Mueller wrote:I had the same thought when reading this. Very disappointing. An issue with zero votes is fixed instead of more important ones.It's a very fair question. Manu works for Remedy Games, a developer of hit PC games, such as Max Payne and Alan Wake. He champions a team that is investigating committing to D for a major new game. This would be a huge design win for D, and an enormous boost for D. I view the most effective use of my time at the moment is to ensure that they can bet on D and win. Remedy's use of D for a high profile product will prove that D is ready and able for the big time, and that others can develop using D with confidence. Nearly all of what he needs the D community needs anyway, such as the big push for Win64 support and the SIMD support (more on that in another post).
Nov 02 2012
On 11/2/2012 10:22 AM, Walter Bright wrote:such as the big push for Win64 supportI want to give a shoutout here for Rainer Schuetze who has been a big help behind the scenes in getting the Win64 symbolic debug support working. He's saved me a ton of time.
Nov 02 2012
On 11/2/12, Walter Bright <newshound2 digitalmars.com> wrote:Manu works for Remedy Games, a developer of hit PC games, such as Max Payne and Alan Wake. He champions a team that is investigating committing to D for a major new game.Wow that's really cool! Manu if you know of any trivial-type bugs you'd like to get fixed (for example error messages) let me know so I can prioritize them. There's a ton of open issues and I usually select the ones for fixing by random. I've managed to fix a few so far. :)
Nov 02 2012
On 11/2/2012 10:32 AM, Andrej Mitrovic wrote:Manu if you know of any trivial-type bugs you'd like to get fixed (for example error messages) let me know so I can prioritize them. There's a ton of open issues and I usually select the ones for fixing by random. I've managed to fix a few so far. :)Thanks, any help would be appreciated. I'll ask Manu for a list of his priority issues, and even minor ones. What will also help is trying out the beta Win64 target. I've been posting nightly new betas for it.
Nov 02 2012
On 11/2/12 1:22 PM, Walter Bright wrote:On 11/2/2012 2:01 AM, Jens Mueller wrote: > I had the same thought when reading this. Very disappointing. An issue > with zero votes is fixed instead of more important ones. It's a very fair question. Manu works for Remedy Games, a developer of hit PC games, such as Max Payne and Alan Wake. He champions a team that is investigating committing to D for a major new game. This would be a huge design win for D, and an enormous boost for D. I view the most effective use of my time at the moment is to ensure that they can bet on D and win. Remedy's use of D for a high profile product will prove that D is ready and able for the big time, and that others can develop using D with confidence. Nearly all of what he needs the D community needs anyway, such as the big push for Win64 support and the SIMD support (more on that in another post).I should add that I'm also totally behind this. When Walter jumped into implementing SIMD support on a hunch, I completely disagreed, but that was a great decision. Andrei
Nov 02 2012
Le 02/11/2012 18:46, Andrei Alexandrescu a écrit :On 11/2/12 1:22 PM, Walter Bright wrote:I still don't understand the benefice over align(16) float[4] .On 11/2/2012 2:01 AM, Jens Mueller wrote:I should add that I'm also totally behind this. When Walter jumped into implementing SIMD support on a hunch, I completely disagreed, but that was a great decision. AndreiI had the same thought when reading this. Very disappointing. An issue with zero votes is fixed instead of more important ones.It's a very fair question. Manu works for Remedy Games, a developer of hit PC games, such as Max Payne and Alan Wake. He champions a team that is investigating committing to D for a major new game. This would be a huge design win for D, and an enormous boost for D. I view the most effective use of my time at the moment is to ensure that they can bet on D and win. Remedy's use of D for a high profile product will prove that D is ready and able for the big time, and that others can develop using D with confidence. Nearly all of what he needs the D community needs anyway, such as the big push for Win64 support and the SIMD support (more on that in another post).
Nov 02 2012
On Fri, 02 Nov 2012 18:10:39 -0000, deadalnix <deadalnix gmail.com> wrot= e:Le 02/11/2012 18:46, Andrei Alexandrescu a =E9crit :On 11/2/12 1:22 PM, Walter Bright wrote:On 11/2/2012 2:01 AM, Jens Mueller wrote:I had the same thought when reading this. Very disappointing. An =xissuewith zero votes is fixed instead of more important ones.It's a very fair question. Manu works for Remedy Games, a developer of hit PC games, such as Ma=nPayne and Alan Wake. He champions a team that is investigating committing to D for a major new game. This would be a huge design wi=myfor D, and an enormous boost for D. I view the most effective use of=time at the moment is to ensure that they can bet on D and win. =bleRemedy's use of D for a high profile product will prove that D is ready and a=e.for the big time, and that others can develop using D with confidenc=eNearly all of what he needs the D community needs anyway, such as th=big push for Win64 support and the SIMD support (more on that in =toanother post).I should add that I'm also totally behind this. When Walter jumped in=timplementing SIMD support on a hunch, I completely disagreed, but tha=http://forum.dlang.org/thread/jauixhakwvpgsghapzvz forum.dlang.org?page=3D= 4#post-k711rd:242786:242:40digitalmars.com R -- = Using Opera's revolutionary email client: http://www.opera.com/mail/was a great decision. AndreiI still don't understand the benefice over align(16) float[4] .
Nov 02 2012
On 2 November 2012 20:10, deadalnix <deadalnix gmail.com> wrote:Le 02/11/2012 18:46, Andrei Alexandrescu a =C3=A9crit : On 11/2/12 1:22 PM, Walter Bright wrote:eOn 11/2/2012 2:01 AM, Jens Mueller wrote:I had the same thought when reading this. Very disappointing. An issu=swith zero votes is fixed instead of more important ones.It's a very fair question. Manu works for Remedy Games, a developer of hit PC games, such as Max Payne and Alan Wake. He champions a team that is investigating committing to D for a major new game. This would be a huge design win for D, and an enormous boost for D. I view the most effective use of my time at the moment is to ensure that they can bet on D and win. Remedy'=ruse of D for a high profile product will prove that D is ready and able for the big time, and that others can develop using D with confidence. Nearly all of what he needs the D community needs anyway, such as the big push for Win64 support and the SIMD support (more on that in anothe=It's a mechanism to insist on register placement and usage semantics. On the vast majority of architectures, floats and simd are absolutely incompatible. It's awfully dangerous to describe them both with a single type when they are mutually exclusive...I still don't understand the benefice over align(16) float[4] .post).I should add that I'm also totally behind this. When Walter jumped into implementing SIMD support on a hunch, I completely disagreed, but that was a great decision. Andrei
Nov 02 2012
On 2012-11-02 18:46, Andrei Alexandrescu wrote:I should add that I'm also totally behind this. When Walter jumped into implementing SIMD support on a hunch, I completely disagreed, but that was a great decision.I can absolutely understand why he did it but it would be really nice if you (Walter, Andrei and probably others as well) could be more transparent about things like these. I think this would really help the community. -- /Jacob Carlborg
Nov 02 2012
Le 02/11/2012 19:19, Jacob Carlborg a écrit :On 2012-11-02 18:46, Andrei Alexandrescu wrote:I couldn't agree more.I should add that I'm also totally behind this. When Walter jumped into implementing SIMD support on a hunch, I completely disagreed, but that was a great decision.I can absolutely understand why he did it but it would be really nice if you (Walter, Andrei and probably others as well) could be more transparent about things like these. I think this would really help the community.
Nov 02 2012
On Friday, 2 November 2012 at 18:19:54 UTC, Jacob Carlborg wrote:On 2012-11-02 18:46, Andrei Alexandrescu wrote:So true. Strong mid-term vision of rationales of main language developers really helps to reason about it.I should add that I'm also totally behind this. When Walter jumped into implementing SIMD support on a hunch, I completely disagreed, but that was a great decision.I can absolutely understand why he did it but it would be really nice if you (Walter, Andrei and probably others as well) could be more transparent about things like these. I think this would really help the community.
Nov 02 2012
Le 02/11/2012 19:25, mist a écrit :On Friday, 2 November 2012 at 18:19:54 UTC, Jacob Carlborg wrote:Yeah, and avoid noise and help people concentrate on main points.On 2012-11-02 18:46, Andrei Alexandrescu wrote:So true. Strong mid-term vision of rationales of main language developers really helps to reason about it.I should add that I'm also totally behind this. When Walter jumped into implementing SIMD support on a hunch, I completely disagreed, but that was a great decision.I can absolutely understand why he did it but it would be really nice if you (Walter, Andrei and probably others as well) could be more transparent about things like these. I think this would really help the community.
Nov 02 2012
On 11/2/2012 11:19 AM, Jacob Carlborg wrote:I can absolutely understand why he did it but it would be really nice if you (Walter, Andrei and probably others as well) could be more transparent about things like these. I think this would really help the community.I apologize for being circumspect about this, but I have to respect peoples' privacy and I cleared what I posted about Remedy with them before posting it.
Nov 02 2012
On 2 November 2012 20:36, Walter Bright <newshound2 digitalmars.com> wrote:On 11/2/2012 11:19 AM, Jacob Carlborg wrote:That said, I think we'd perhaps appreciate that it doesn't appear all over the internets just yet. It would be much more interesting, and probably have a lot more impact if we made such an announcement alongside something to show.I can absolutely understand why he did it but it would be really nice if you (Walter, Andrei and probably others as well) could be more transparent about things like these. I think this would really help the community.I apologize for being circumspect about this, but I have to respect peoples' privacy and I cleared what I posted about Remedy with them before posting it.
Nov 02 2012
On 2012-11-02 19:36, Walter Bright wrote:I apologize for being circumspect about this, but I have to respect peoples' privacy and I cleared what I posted about Remedy with them before posting it.This has nothing to do with what Manu does for a living (sure, mentioning Remedy gives it more weight, at least for me). It's more in the line of creating a post/starting a new thread saying something like: "After a throughout discussion with Manu (or 'a fellow D programmer' if he/she prefers to be anonymous) we have decided it would be in best interest of D if we implement this particular feature. From now on this is where I will focus most most of my time". Something like this would be far better then suddenly seeing commits regarding SIMD (or whatever feature it might be) for out of the blue. -- /Jacob Carlborg
Nov 02 2012
"After a throughout discussion with Manu (or 'a fellow D programmer' if he/she prefers to be anonymous) we have decided it would be in best interest of D if we implement this particular feature. From now on this is where I will focus most most of my time". Something like this would be far better then suddenly seeing commits regarding SIMD (or whatever feature it might be) for out of the blue.SIMD support was discussed here at length in the days before it was implemented. See this thread: http://forum.dlang.org/thread/jdhb57$10vf$1 digitalmars.com#post-wdjdcrkiaakmkzqtdhxu:40dfeed.kimsufi.thecybershadow.net and this thread: http://forum.dlang.org/post/mailman.76.1325814175.16222.digitalmars-d puremagic.com
Nov 02 2012
On 2012-11-02 21:22, jerro wrote:SIMD support was discussed here at length in the days before it was implemented. See this thread:Yeah, I know it's been talked about and discussed, but it's the final decision that's missing. -- /Jacob Carlborg
Nov 02 2012
Walter Bright wrote:On 11/2/2012 11:19 AM, Jacob Carlborg wrote:There is no need to reveal anything private just because you have a road map. JensI can absolutely understand why he did it but it would be really nice if you (Walter, Andrei and probably others as well) could be more transparent about things like these. I think this would really help the community.I apologize for being circumspect about this, but I have to respect peoples' privacy and I cleared what I posted about Remedy with them before posting it.
Nov 02 2012
On 2 November 2012 20:19, Jacob Carlborg <doob me.com> wrote:On 2012-11-02 18:46, Andrei Alexandrescu wrote: I should add that I'm also totally behind this. When Walter jumped intoThis is probably my fault, and a matter of corporate transparency. We didn't want to make a noise about it until we reached a particular level of confidence. We're fairly invested now, and quietly hopeful it will go ahead from here.implementing SIMD support on a hunch, I completely disagreed, but that was a great decision.I can absolutely understand why he did it but it would be really nice if you (Walter, Andrei and probably others as well) could be more transparent about things like these. I think this would really help the community.
Nov 02 2012
On 2012-11-02 20:22, Manu wrote:This is probably my fault, and a matter of corporate transparency. We didn't want to make a noise about it until we reached a particular level of confidence. We're fairly invested now, and quietly hopeful it will go ahead from here.This has nothing to do with corporate transparency. It has to do with transparency to the community, see my reply to Walter: http://forum.dlang.org/thread/jauixhakwvpgsghapzvz forum.dlang.org?page=6#post-k718iu:242iu6:241:40digitalmars.com -- /Jacob Carlborg
Nov 02 2012
Andrei Alexandrescu wrote:On 11/2/12 1:22 PM, Walter Bright wrote:On 11/2/2012 2:01 AM, Jens Mueller wrote:I should add that I'm also totally behind this. When Walter jumped into implementing SIMD support on a hunch, I completely disagreed, but that was a great decision.I had the same thought when reading this. Very disappointing. An issue with zero votes is fixed instead of more important ones.It's a very fair question. Manu works for Remedy Games, a developer of hit PC games, such as Max Payne and Alan Wake. He champions a team that is investigating committing to D for a major new game. This would be a huge design win for D, and an enormous boost for D. I view the most effective use of my time at the moment is to ensure that they can bet on D and win. Remedy's use of D for a high profile product will prove that D is ready and able for the big time, and that others can develop using D with confidence. Nearly all of what he needs the D community needs anyway, such as the big push for Win64 support and the SIMD support (more on that in another post).From the inside you can tell it is a great decision. From the outside itlooks different. Jens
Nov 02 2012
On 2012-11-02 18:22, Walter Bright wrote:It's a very fair question. Manu works for Remedy Games, a developer of hit PC games, such as Max Payne and Alan Wake. He champions a team that is investigating committing to D for a major new game. This would be a huge design win for D, and an enormous boost for D. I view the most effective use of my time at the moment is to ensure that they can bet on D and win. Remedy's use of D for a high profile product will prove that D is ready and able for the big time, and that others can develop using D with confidence. Nearly all of what he needs the D community needs anyway, such as the big push for Win64 support and the SIMD support (more on that in another post).I can absolutely see the point in this. Thanks for taking the time and explaining this. -- /Jacob Carlborg
Nov 02 2012
On 2 November 2012 19:32, Andrej Mitrovic <andrej.mitrovich gmail.com>wrote:On 11/2/12, Walter Bright <newshound2 digitalmars.com> wrote:Hey cheers man! :) Actually, one thing that does consistently bite me are nonsensical error messages. I'll start keeping tabs on them.Manu works for Remedy Games, a developer of hit PC games, such as MaxPayneand Alan Wake. He champions a team that is investigating committing to D foramajor new game.Wow that's really cool! Manu if you know of any trivial-type bugs you'd like to get fixed (for example error messages) let me know so I can prioritize them. There's a ton of open issues and I usually select the ones for fixing by random. I've managed to fix a few so far. :)
Nov 02 2012
Walter Bright wrote:On 11/2/2012 2:01 AM, Jens Mueller wrote:Now I can understand why you made these decisions. It makes sense to me. But I'd like to know which direction the ship is sailing. The current rationale is to proof that D is ready for prime time. Though I fear that some issues in the bug tracker may give a bad impression. But in general the decision process should be as open and transparent as possible. In Jacob's words: We need a road map. JensI had the same thought when reading this. Very disappointing. An issue with zero votes is fixed instead of more important ones.It's a very fair question. Manu works for Remedy Games, a developer of hit PC games, such as Max Payne and Alan Wake. He champions a team that is investigating committing to D for a major new game. This would be a huge design win for D, and an enormous boost for D. I view the most effective use of my time at the moment is to ensure that they can bet on D and win. Remedy's use of D for a high profile product will prove that D is ready and able for the big time, and that others can develop using D with confidence. Nearly all of what he needs the D community needs anyway, such as the big push for Win64 support and the SIMD support (more on that in another post).
Nov 02 2012
On 11/02/2012 09:07 AM, Jacob Carlborg wrote:On 2012-11-01 23:51, Walter Bright wrote:SIMD support is necessary and the fix for 8108 is very simple. If the way default arguments work shall be improved though, it would add additional ways that the compiler can screw up conditional compilation.What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented.Although I think something like AST macros could possible solve issue 8108 and a whole bunch of other features, a few already present in the language.A sufficiently well/badly designed macro feature can potentially replace most other language features.
Nov 02 2012
Uh oh, I just caught wind of this thread! ;) If there's a single argument I'd like to make in defense of the changes that have gone through as a result of my motivating, it's that they're either big tickets and mutually beneficial for the whole community anyway (DMD-win64), or relatively trivial (function prototypes + definitions) details that enable us to realistically consider proceeding with D commercially. The SIMD types support may be considered a little grey, but I've encountered loads of general D users who appreciate the SIMD work already, and while it's certainly not trivial, it's nowhere the mammoth scale of task auto-vectorisation would be. I can't see it as a loss for the language or the community, and again, it has further enabled our consideration of D commercially; which I'd like to think is a general goal for the language. I know plenty of you don't care about me or my industry, but I maintain that it's an entire industry in desperate need of salvation from C++, there's a lot of potential in the games industry to get fantastic value from using D, and I'm interested in proving that it's a realistic consideration. I'd also like to note that we are also very conscious of the time Walter and other contributors have kindly offered to our support, and we are hopeful to be able to give reasonable value back to the community should it all go well for us, in whatever way that manifests... On 2 November 2012 11:01, Jens Mueller <jens.k.mueller gmx.de> wrote:Jacob Carlborg wrote:As I mentioned above, I think that is a MUCH larger task, and probably fairly unrealistic in the near-term regardless. But secondly, it's just not that simple. (I can see Walter has already addressed it in a previous post) It's worth considering that a very significant portion of the silicon on modern processors (well in excess of 50% on some chips) is dedicated to hardware acceleration of SIMD/media functions. Until recently, D simply offered no mechanism at all to interact with half of the silicone in your box. That's a massive language hole. At least as a starting point, low level access to this hardware is vital. Portable libraries can be built using this technology, which are immediately useful. The definition of hardware SIMD types doesn't rule out possible future auto-vectorisation either. And you can probably access auto-vectorising backends right now if you use GDC or LDC.On 2012-11-01 23:51, Walter Bright wrote:I had the same thought when reading this. Very disappointing. An issue with zero votes is fixed instead of more important ones. Why do I vote anyway? Regarding SIMD I have the feeling that because it is built into the compiler static vectors have actually failed what they promised. I thought D proposed a portable way of vector operations such that you write float[4] = a[] + b[] and the compiler generates SIMD code for you.What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.This is quite interesting. Manu comes in from basically nowhere and fairly quickly manage to convince Walter to implement at least two feature requests, this one and the SIMD support. I'm not saying that they shouldn't have been implemented. Although I think something like AST macros could possible solve issue 8108 and a whole bunch of other features, a few already present in the language.
Nov 02 2012
On 11/1/12 6:51 PM, Walter Bright wrote:On 11/1/2012 2:20 PM, bearophile wrote:I'd argue this actually is part of a category of features that does not increase the complexity of the language (quite the contrary in fact). This is because stating that declaration+definition in the same file won't work takes actually more cognitive load than just allowing it. By the consistency principle, one should infer unknown parts of a complex system from knowing the others. Consider then this setup: * Declarations (without definition) of functions are allowed. * Definitions are allowed. * Declarations and definitions are allowed in distinct files in the same project as long as they match. At this point, it is more tenuous to argue that "same file" is a special case that should prevent declarations and definitions to coexist, than to just let it happen and let the consistency principle take care of explaining it. AndreiSome complexity comes from the desire to do more and more. As example see this recent request from Manu,What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why he needs it, and there's no other reasonable way. He needs it for real code in a real application.
Nov 02 2012
On Thursday, 1 November 2012 at 18:06:21 UTC, Peter Alexander wrote:On Wednesday, 31 October 2012 at 23:04:15 UTC, bearophile wrote:I think that is the case of any multi-paradigm language. It is already enough to allow both functional and OO style of programming to have hundreds of things to think about... That is exactly one of the major reasons why people prefer Java over other languages...The thread contains some sad comments:It's unfortunate that there's still bad press circulating about a situation that is long gone. I suppose you just have to try and ignore those people. A more interesting comment is this one: "But the real problem here is that in order to achieve even that, the complexity and amount of concepts you have to deal with in C++11 is mind boggling." The same is true in D. Well-written D code often does look rather elegant, but the amount of understanding needed to write beautiful D code is staggering.
Nov 02 2012