Re: winsamp sample crashed windbg

2009-03-15 Thread ws
Walter Bright Wrote: > ws wrote: > > Here is what i did: > > > > c:\>windbg winsamp.exe Press F5 to start running, then just close the > > winsamp.exe. > > > > Couple of secs later windbg crashed with 'The instruction at > > 0x731444fe referenced memory at 0x...' while it is unloading >

Re: winsamp sample crashed windbg

2009-03-15 Thread Walter Bright
ws wrote: Ah, finally I found the culprit! It is the unlocker.exe running in the background, and that crashes windbg running D windows app consistently when it exits. (does not affect the console app). Took me a long time to find out. Thanks for your concerns! What's unlocker.exe ?

Re: winsamp sample crashed windbg

2009-03-15 Thread Tomas Lindquist Olsen
On Sun, Mar 15, 2009 at 10:46 AM, Walter Bright wrote: > ws wrote: >> >> Ah, finally I found the culprit! >> It is the unlocker.exe running in the background, and that crashes windbg >> running D windows app consistently when it exits. (does not affect the >> console app). >> Took me a long time t

Re: Updated D Benchmarks

2009-03-15 Thread bearophile
Robert Clipsham, the pages are indeed improved a lot. Thank you for your work. >with all benchmarks limited to 256mb memory usage< - Some benchmarks of the Shootout site will probably need more than 256 mb of RAM. > The only request I believe I've missed (correct me if I'm wrong!) is a C > or

Re: Updated D Benchmarks

2009-03-15 Thread Robert Clipsham
bearophile wrote: Robert Clipsham, the pages are indeed improved a lot. Thank you for your work. Thanks, I'm glad you approve! with all benchmarks limited to 256mb memory usage< - Some benchmarks of the Shootout site will probably need more than 256 mb of RAM. None of the ones that I'm cu

Re: Proposal: fixing the 'pure' floating point problem.

2009-03-15 Thread Don
Don wrote: Walter Bright wrote: Don wrote: The math functions need to work for any rounding mode, not just the default mode. They also set the status flags correctly. In fact, they are almost the only functions where this matters! Ok, then std.math functions cannot be pure in either your or

Re: memcpy vs slice copy

2009-03-15 Thread Moritz Warning
On Sat, 14 Mar 2009 23:50:58 -0400, bearophile wrote: > While doing some string processing I've seen some unusual timings > compared to the C code, so I have written this to see the situation > better. When USE_MEMCPY is false this little benchmark runs about 3+ > times slower: I did a little ben

Populating Date struct from d_time value

2009-03-15 Thread Steve Teale
What is the recommended way of populating a std.date Date struct from a d_time value returned by getUTCtime()? I'm probably being very dense, but it seems to me that at present I have to convert the d_time value to a formatted date string, and then parse that. This seems very inefficient. Also

Re: Updated D Benchmarks

2009-03-15 Thread bearophile
Robert Clipsham: I have seen you have put all graphs in a page. This is probably better. When you have 10-20 benchmarks you may need less thick bars. You can add the raw timings, formatted into an ASCII table, a bit like this (don't use an HTML table): http://zi.fi/shootout/rawresults.txt There

Re: memcpy vs slice copy

2009-03-15 Thread bearophile
Moritz Warning: > I don't see a very big difference between slice copying and memcpy (but > between compilers). I have taken the times again. My timings, best of 4: true: 1.33 s false: 4.28 s I have used dmd 1.041, with Phobos, on WinXP 32 bit, 2 GB RAM, CPU Core 2 at 2 GHz. This may be anothe

Re: Updated D Benchmarks

2009-03-15 Thread Robert Clipsham
bearophile wrote: Robert Clipsham: I have seen you have put all graphs in a page. This is probably better. When you have 10-20 benchmarks you may need less thick bars. You can add the raw timings, formatted into an ASCII table, a bit like this (don't use an HTML table): http://zi.fi/shootout/

Re: memcpy vs slice copy

2009-03-15 Thread Moritz Warning
On Sun, 15 Mar 2009 13:17:50 +, Moritz Warning wrote: > On Sat, 14 Mar 2009 23:50:58 -0400, bearophile wrote: > >> While doing some string processing I've seen some unusual timings >> compared to the C code, so I have written this to see the situation >> better. When USE_MEMCPY is false this

Re: memcpy vs slice copy

2009-03-15 Thread Sergey Gromov
Sun, 15 Mar 2009 13:17:50 + (UTC), Moritz Warning wrote: > On Sat, 14 Mar 2009 23:50:58 -0400, bearophile wrote: > >> While doing some string processing I've seen some unusual timings >> compared to the C code, so I have written this to see the situation >> better. When USE_MEMCPY is false th

Re: memcpy vs slice copy

2009-03-15 Thread bearophile
For reference here's a simple C version: #include "stdlib.h" #include "string.h" #include "stdio.h" #define N 1 #define L 6 char h[L] = "hello\n"; int main() { char *ptr; if (N <= 100) ptr = malloc(N * L + 1); // the +1 is for the final printing else ptr = ma

Re: Updated D Benchmarks

2009-03-15 Thread bearophile
Robert Clipsham: >I've got a better idea. That page is automatically generated from an xml file, >I'll just make that available instead.< I don't like XML; a small txt table is so easy to process with three lines of Python... :-) (Json is fine too). >I would probably have to exclude tests tha

Re: DMD Mac and linking with frameworks

2009-03-15 Thread Anders F Björklund
Jacob Carlborg wrote: (it would however be nice if DMD for Mac OS X could be taught to accept the most straightforward syntax for it, i.e. "dmd -framework Carbon") I asked that ldc should add this but they said something about a linker flag shouldn't be available as a compiler flag. I guess

Re: memcpy vs slice copy

2009-03-15 Thread Sergey Gromov
Sun, 15 Mar 2009 10:31:10 -0400, bearophile wrote: > The ASM of the inner loop: > > L: movl_h, %eax > movl%eax, (%edx) > movzwl _h+4, %eax > movw%ax, 4(%edx) > addl$6, %edx > cmpl%ecx, %edx > jne L Obviously, a memcpy intrinsic is at work here. DMD

Re: memcpy vs slice copy

2009-03-15 Thread bearophile
Sergey Gromov: > Obviously, a memcpy intrinsic is at work here.< Yes, gcc is able to recognize some calls to C library functions and replace them with intrinsics. I think LDC too uses an intrinsic to copy memory of a slice. This isn't a too much interesting benchmark, there's nothing much intere

Re: Updated D Benchmarks

2009-03-15 Thread Robert Clipsham
bearophile wrote: I don't like XML; a small txt table is so easy to process with three lines of Python... :-) (Json is fine too). If you would like to provide me with a script to convert the xml file to a text table, I'll happily run it and make it available to you. As it is I'm too lazy to

Re: Proposal: adding condition variable to object monitors

2009-03-15 Thread Sean Kelly
Oh, on Windows, condition variables were added in Vista, so that code won't work on XP or earlier.

Re: Proposal: adding condition variable to object monitors

2009-03-15 Thread Sean Kelly
They're already in druntime for D2, though they haven't been distributed yet (dunno why). And they can act like they're built in: class C { Mutex m; Condition c; this() { // make m this object's monitor m = new Mutex( this ); c = new Condition( m );

Re: Proposal: adding condition variable to object monitors

2009-03-15 Thread Jeremie Pelletier
Sean Kelly Wrote: > They're already in druntime for D2, though they haven't been distributed > yet (dunno why). And they can act like they're built in: > > class C > { > Mutex m; > Condition c; > > this() > { > // make m this object's monitor > m = new

Re: Proposal: adding condition variable to object monitors

2009-03-15 Thread Sean Kelly
Jeremie Pelletier wrote: Sean Kelly Wrote: They're already in druntime for D2, though they haven't been distributed yet (dunno why). And they can act like they're built in: class C { Mutex m; Condition c; this() { // make m this object's monitor m =

Re: Updated D Benchmarks

2009-03-15 Thread naryl
Robert Clipsham Wrote: > bearophile wrote: > > I don't like XML; a small txt table is so easy to process with three lines > > of Python... :-) > > (Json is fine too). > > If you would like to provide me with a script to convert the xml file to > a text table, I'll happily run it and make it ava

Re: Populating Date struct from d_time value

2009-03-15 Thread Walter Bright
Steve Teale wrote: What is the recommended way of populating a std.date Date struct from a d_time value returned by getUTCtime()? I'm probably being very dense, but it seems to me that at present I have to convert the d_time value to a formatted date string, and then parse that. This seems very

Re: Proposal: fixing the 'pure' floating point problem.

2009-03-15 Thread Walter Bright
Let's say we have A which is in a floatingpoint module, B which is in a non-floatingpoint module and C which is marked pure in a non-floatingpoint module: - module A(floatingpoint); void a() { set mode; b(); restore mode; } module B;

Associative Arrays and GC

2009-03-15 Thread dsimcha
Following up on a discussion from yesterday, it's become increasingly clear to me that the current associative array implementation interacts poorly with conservative garbage collection and D's memory allocator. In the current design, we have a struct that holds two pointers, the hash, the key and

Re: Proposal: fixing the 'pure' floating point problem.

2009-03-15 Thread Don
Walter Bright wrote: Let's say we have A which is in a floatingpoint module, B which is in a non-floatingpoint module and C which is marked pure in a non-floatingpoint module: - module A(floatingpoint); void a() { set mode; b(); restore mode; } -

Re: Proposal: fixing the 'pure' floating point problem.

2009-03-15 Thread bearophile
Joel C. Salomon: > On the 754r mailing list, the HPC crowd was *very* insistent that static > modes be explicitly in the standard. Because in technology lot of things aren't determined on technological merits, but by politics, money and power. Sometimes behind some of the best things you can fin

Re: Proposal: fixing the 'pure' floating point problem.

2009-03-15 Thread Walter Bright
Don wrote: A has called a function in B. B is not a floatingpoint module, so b() can only be called when the mode is set back to the default. a() violates this contract, so a() is incorrect. There's nothing wrong with b() or c(). If a() wants to call b(), it needs to restore the mode first; or

Re: Updated D Benchmarks

2009-03-15 Thread bearophile
naryl: > I think this will suffice: > $ sed 's/<[^>]*>//g; /^$/d' < data | sed 'N; N; N; N; N; N; s/\n/ /g' A Python version a little more resilient to changes in that file: from xml.dom.minidom import parse results1 = parse("results.xml").getElementsByTagName("results") results = results1[0].get

Re: Updated D Benchmarks

2009-03-15 Thread bearophile
Sorry, assuming a "tidy XML file" is silly. Better: from xml.dom.minidom import parse r = parse("results.xml").getElementsByTagName("results") results = r[0].getElementsByTagName("result") # print field names fields = [n.localName for n in results[0].childNodes if n.nodeType != n.TEXT_NODE] pri

Re: Proposal: adding condition variable to object monitors

2009-03-15 Thread Jeremie Pelletier
Sean Kelly Wrote: > I considered this as well, but it imposes limitations that aren't > present with the current approach. It's possible to have more than one > condition associated with a particular mutex, for example, and to plug > in a shared mutex for interprocess synchronization using 'sy

Bug? package attribute half working on child packages.

2009-03-15 Thread Jeremie Pelletier
I don't know if it's really a bug, but the package protection attribute seems to have a different semantic in the current packages than in nested packages. For example, say you have the module test which declares the following: --- module test.Foo; package uint myVar; package class MyClass {} p

Re: Proposal: fixing the 'pure' floating point problem.

2009-03-15 Thread Daniel Keep
bearophile wrote: > Joel C. Salomon: >> On the 754r mailing list, the HPC crowd was *very* insistent that static >> modes be explicitly in the standard. > > Because in technology lot of things aren't determined on technological > merits, but by politics, money and power. Sometimes behind some o

Re: catchy phrase for this idiom?

2009-03-15 Thread Tim M
On Sun, 15 Mar 2009 06:27:42 +1300, BCS wrote: there is no compact form for alias but this T Foo(T)(T t) { return t; } is internally identical the the more verbose form: template Foo(T) { T Foo(T t){ return t; } } Hi BCS. On this page: http://www.digitalmars.com/d/1.0/template.html sc

Re: Bug? package attribute half working on child packages.

2009-03-15 Thread Jarrett Billingsley
On Sun, Mar 15, 2009 at 5:55 PM, Jeremie Pelletier wrote: > I don't know if it's really a bug, but the package protection attribute seems > to have a different semantic in the current packages than in nested packages. > > For example, say you have the module test which declares the following: > -

Re: Updated D Benchmarks

2009-03-15 Thread bearophile
Robert Clipsham, eventually your site may become like this page (it may be slow to load, you may need to load it later too): http://sbcl.boinkor.net/bench/ It's also useful to see how performance evolves across versions, like a brother of bugzilla, to spot performance bugs. Bye, bearophile

Re: catchy phrase for this idiom?

2009-03-15 Thread BCS
Hello Tim, On Sun, 15 Mar 2009 06:27:42 +1300, BCS wrote: there is no compact form for alias but this T Foo(T)(T t) { return t; } is internally identical the the more verbose form: template Foo(T) { T Foo(T t){ return t; } } Hi BCS. On this page: http://www.digitalmars.com/d/1.0/template

Re: Bug? package attribute half working on child packages.

2009-03-15 Thread Daniel Keep
Jarrett Billingsley wrote: > On Sun, Mar 15, 2009 at 5:55 PM, Jeremie Pelletier wrote: >> I don't know if it's really a bug, but the package protection attribute >> seems to have a different semantic in the current packages than in nested >> packages. >> >> For example, say you have the module

Re: Proposal: fixing the 'pure' floating point problem.

2009-03-15 Thread Sergey Gromov
Sun, 15 Mar 2009 13:50:07 -0700, Walter Bright wrote: > Don wrote: >> Something interesting about my proposal is that although it is motivated >> by the purity problem, that's simply a rule for the compiler -- the >> rules for programmers do not involve purity at all.(See my other post). >> Do

Re: Bug? package attribute half working on child packages.

2009-03-15 Thread Jarrett Billingsley
On Sun, Mar 15, 2009 at 7:53 PM, Daniel Keep wrote: > > > Jarrett Billingsley wrote: >> On Sun, Mar 15, 2009 at 5:55 PM, Jeremie Pelletier >> wrote: >>> I don't know if it's really a bug, but the package protection attribute >>> seems to have a different semantic in the current packages than in

Re: winsamp sample crashed windbg

2009-03-15 Thread ws
Tomas Lindquist Olsen Wrote: > On Sun, Mar 15, 2009 at 10:46 AM, Walter Bright > wrote: > > ws wrote: > >> > >> Ah, finally I found the culprit! > >> It is the unlocker.exe running in the background, and that crashes windbg > >> running D windows app consistently when it exits. (does not affect t

LG Post Asking about D

2009-03-15 Thread Jesse Phillips
There was a LiveJournal post asking about the D Programming language about a week ago. Interesting to see a fairly neutral discussion on the interest of the language. Wasn't sure if anyone would want to pitch in some points. http://patrick-compsci.livejournal.com/12857.html