Re: The review of std.hash package

2012-08-15 Thread ReneSac
On Wednesday, 15 August 2012 at 14:36:00 UTC, José Armando García Sancio wrote: Some people's point is that MD5 was consider a cryptographic digest function 16 years ago. It is not consider cryptographically secure today. So why make any design assumption today on how the landscape will look

Re: Optional extra return value? Multiple return values with auto?

2012-08-15 Thread ReneSac
On Wednesday, 15 August 2012 at 01:22:41 UTC, Era Scarecrow wrote: On Wednesday, 15 August 2012 at 00:37:32 UTC, ReneSac wrote: And my last question of my first post: I can't use auto for the out values right? An enhancement proposal like this would be compatible with D? I would say

Re: Optional extra return value? Multiple return values with auto?

2012-08-14 Thread ReneSac
Thanks, this indeed works. One obvious (when your program starts to behave weirdly...) down side of this solution: it needs a different dummy for each optional out value of a function, or else multiple variables will be modifying the same dummy. And, of course, a different dummy for each type

Re: Optional extra return value? Multiple return values with auto?

2012-08-11 Thread ReneSac
On Tuesday, 24 July 2012 at 05:30:49 UTC, Ali Çehreli wrote: The options that I can think of: - Return a struct (or a class) where one of the members is not filled-in - Similarly, return a tuple This is awkward, and doesn't look good for performance. - Use an out parameter, which can

Optional extra return value? Multiple return values with auto?

2012-07-23 Thread ReneSac
How I can return multiple values in D, but one of them being optional? I tried the 'out' hack to achieve multiple return values, but it didn't accepted a default argument: it needed a lvalue in the calling function. In Lua, for example, one can do: function foo(input) -- calculations --

Re: D 50% slower than C++. What I'm doing wrong?

2012-04-16 Thread ReneSac
On Monday, 16 April 2012 at 07:28:25 UTC, Andrea Fontana wrote: Are you on linux/windows/mac? Windows. My main question is now *WHY* D is slower than C++ in this program? The code is identical (even the same C functions) in the performance-critical parts, I'm using the same compiler backend

Re: D 50% slower than C++. What I'm doing wrong?

2012-04-16 Thread ReneSac
On Monday, 16 April 2012 at 22:58:08 UTC, Timon Gehr wrote: On 04/17/2012 12:24 AM, ReneSac wrote: Windows. DMC runtime ! DMC = Digital Mars Compiler? Does Mingw/GDC uses that? I think that both, g++ and GDC compiled binaries, use the mingw runtime, but I'm not sure also

Re: D 50% slower than C++. What I'm doing wrong?

2012-04-15 Thread ReneSac
On Sunday, 15 April 2012 at 02:56:21 UTC, Joseph Rushton Wakeling wrote: On Saturday, 14 April 2012 at 19:51:21 UTC, Joseph Rushton Wakeling wrote: GDC has all the regular gcc optimization flags available IIRC. The ones on the GDC man page are just the ones specific to GDC. I'm not talking

D 50% slower than C++. What I'm doing wrong?

2012-04-14 Thread ReneSac
I have this simple binary arithmetic coder in C++ by Mahoney and translated to D by Maffi. I added notrow, final and pure and GC.disable where it was possible, but that didn't made much difference. Adding const to the Predictor.p() (as in the C++ version) gave 3% higher performance. Here the

Re: D 50% slower than C++. What I'm doing wrong?

2012-04-14 Thread ReneSac
I tested the q66 version in my computer (sandy bridge @ 4.3GHz). Repeating the old timmings here, and the new results are marked as D-v2: test.fpaq0 (16562521 bytes) - test.bmp (33159254 bytes) Lang| Comp | Binary size | Time (lower is better) C++ (g++) - 13kb - 2.42s (100%) -O3

Re: Up to date documentation on D implementation.

2012-04-07 Thread ReneSac
On Saturday, 7 April 2012 at 06:21:16 UTC, Dmitry Olshansky wrote: On 07.04.2012 8:51, ReneSac wrote: The only thing I noticed is that a simple Hello World took several seconds to compile, and ended up with 1.25MB (release, non-debug build)! how about strip it? + MinGW debug info

Re: Input from a newbie

2012-04-07 Thread ReneSac
On Saturday, 7 April 2012 at 22:21:36 UTC, Jonas wrote: 5) What's wrong with this program? Is it that `printf` doesn't understand D strings? If so, how do I use D strings in string formatting? import std.stdio; string foo() { return foobar; } int main() { printf(%s\n, foo()); return

Re: Up to date documentation on D implementation.

2012-04-06 Thread ReneSac
On Friday, 6 April 2012 at 01:33:10 UTC, Mike Parker wrote: DMD runs just fine on 64-bit Windows. Then why 32 bit Windows (Win32) operating system, such as Windows XP is put as a requirement? This should be corrected: http://dlang.org/dmd-windows.html Anyway, in the mean time I have setup

Re: Up to date documentation on D implementation.

2012-04-05 Thread ReneSac
On Thursday, 5 April 2012 at 18:34:05 UTC, Jesse Phillips wrote: You'll be pretty safe using features you know for C, but you can venture out pretty far from it. While, the page isn't specific to the questions you have at hand, this does cover much of the current state. Remember, recently

Re: Up to date documentation on D implementation.

2012-04-05 Thread ReneSac
On Thursday, 5 April 2012 at 22:07:05 UTC, Jesse Phillips wrote: On Thursday, 5 April 2012 at 21:10:41 UTC, ReneSac wrote: I will probably program close to C/Lua style (the languages I'm most proficient with), but pretty far is vague. And I haven't been following the time line of the feature