digitalmars.D - Keyword 'dynamic' of C#4
- bearophile (5/5) Apr 27 2009 A pair of short posts that show the "dynamic" keyword of C#4:
- Unknown W. Brackets (13/21) Apr 27 2009 I read until I hit this:
- Don (5/12) Apr 28 2009 Yeah. I've been worried that D is getting too complicated; I'm worried
- Christopher Wright (4/11) Apr 28 2009 It's decompiled: "This is where our friend Reflector comes in."
- Unknown W. Brackets (5/18) Apr 28 2009 Specifically, I'm concerned about ".<>". What is that? I guess it's a
- Benji Smith (7/10) Apr 28 2009 Actually, he does. It's at the bottom of the "second look" post:
- Unknown W. Brackets (7/20) Apr 28 2009 No, these are averages of run time. These are not the upfront costs,
http://www.codethinked.com/post/2008/10/28/C-40-New-Features-Part-1-dynamic-keyword.aspx http://www.codethinked.com/post/2008/10/28/C-40-New-Features-Part-11-dynamic-keyword-second-look.aspx Bye, bearophile
Apr 27 2009
I read until I hit this: 4. if (<Main>o__SiteContainer0.<>p__Site1 == null) And I was suddenly hit with a huge feeling of "I'm glad D doesn't look like this." Seriously, I hope this is some sort of decompiled syntax and not actually valid. I wonder what the overhead times were. He should've timed them both and listed them separately. For example, is DynamicMethod a complete win, or is the dynamic keyword cheaper as far as base cost? This reminds me of the opDotExp discussion. I can see that caching the cost could potentially be beneficial, as shown here. That's the main offshoot I get from it. -[Unknown] bearophile wrote:http://www.codethinked.com/post/2008/10/28/C-40-New-Features-Part-1-dynamic-keyword.aspx http://www.codethinked.com/post/2008/10/28/C-40-New-Features-Part-11-dynamic-keyword-second-look.aspx Bye, bearophile
Apr 27 2009
Unknown W. Brackets wrote:I read until I hit this: 4. if (<Main>o__SiteContainer0.<>p__Site1 == null) And I was suddenly hit with a huge feeling of "I'm glad D doesn't look like this." Seriously, I hope this is some sort of decompiled syntax and not actually valid.Yeah. I've been worried that D is getting too complicated; I'm worried that it's lost too much of its original simplicity. But then I look at complexity, yet with a lot less power than D.
Apr 28 2009
Unknown W. Brackets wrote:I read until I hit this: 4. if (<Main>o__SiteContainer0.<>p__Site1 == null) And I was suddenly hit with a huge feeling of "I'm glad D doesn't look like this." Seriously, I hope this is some sort of decompiled syntax and not actually valid.It's decompiled: "This is where our friend Reflector comes in." It's also probably valid. However, no sane person would write that way, so it's not a huge issue. You can do similarly ugly things in D.
Apr 28 2009
Specifically, I'm concerned about ".<>". What is that? I guess it's a namespace, and so it's an empty one. That just seems wrong... like D having "x..y" or "x.!()y", which it definitely doesn't have. -[Unknown] Christopher Wright wrote:Unknown W. Brackets wrote:I read until I hit this: 4. if (<Main>o__SiteContainer0.<>p__Site1 == null) And I was suddenly hit with a huge feeling of "I'm glad D doesn't look like this." Seriously, I hope this is some sort of decompiled syntax and not actually valid.It's decompiled: "This is where our friend Reflector comes in." It's also probably valid. However, no sane person would write that way, so it's not a huge issue. You can do similarly ugly things in D.
Apr 28 2009
Unknown W. Brackets wrote:I wonder what the overhead times were. He should've timed them both and listed them separately. For example, is DynamicMethod a complete win, or is the dynamic keyword cheaper as far as base cost?Actually, he does. It's at the bottom of the "second look" post: Compile Time Bound: 6 ms Dynamically Bound with dynamic keyword: 45ms Dynamically Bound with MethodInfo.Invoke - 10943ms Dynamically Bound with DynamicMethod - 8ms --benji
Apr 28 2009
No, these are averages of run time. These are not the upfront costs, but instead the average over 2 million calls or whatever. For example, if DynamicMethod takes 20000ms upfront (to compile the il, although that seems way too long), it might still be smarter to use the dynamic keyword even in performance critical code. -[Unknown] Benji Smith wrote:Unknown W. Brackets wrote:I wonder what the overhead times were. He should've timed them both and listed them separately. For example, is DynamicMethod a complete win, or is the dynamic keyword cheaper as far as base cost?Actually, he does. It's at the bottom of the "second look" post: Compile Time Bound: 6 ms Dynamically Bound with dynamic keyword: 45ms Dynamically Bound with MethodInfo.Invoke - 10943ms Dynamically Bound with DynamicMethod - 8ms --benji
Apr 28 2009