June 22, 2013
Ali Çehreli:

> The code compiles under 32-bit (e.g. with the -m32 compiler switch) where size_t is an alias of uint.

Oh, I see. I compile most of the code on a 32 bit system.

I asked Walter to warn d programmers against such mistakes, and Walter closed it down. Someone else has opened the ER again...

Bye,
bearophile
June 22, 2013
> I asked Walter to warn d programmers against such mistakes, and Walter closed it down. Someone else has opened the ER again...

I meant this:
http://d.puremagic.com/issues/show_bug.cgi?id=5063

In the meantime I have fixed the Rosettacode entry.

Bye,
bearophile
June 23, 2013
Adam D. Ruppe:

> code:
> http://arsdnet.net/dcode/rpc-example.d
>
> library:
> https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/rpc.d

It's online:
http://rosettacode.org/wiki/Distributed_programming#D

Bye,
bearophile
June 24, 2013
On Saturday, 22 June 2013 at 21:27:01 UTC, bearophile wrote:
> Ali Çehreli:
>
>> The code compiles under 32-bit (e.g. with the -m32 compiler switch) where size_t is an alias of uint.

Thanks, Ali! I'm always compiling on 64 bit systems; I'll add the 32 bit switch to my diagnostic approach now.

> Oh, I see. I compile most of the code on a 32 bit system.
>
> I asked Walter to warn d programmers against such mistakes, and Walter closed it down. Someone else has opened the ER again...

In general, I think implicit conversions of any kind are a misfeature, but better error messages would be enough for me here. At least in Scala, you need to bring the conversion into scope yourself, or have it accidentally imported...

Thanks for your help.

-- Brian
July 03, 2013
Am Sat, 22 Jun 2013 23:27:00 +0200
schrieb "bearophile" <bearophileHUGS@lycos.com>:

> Ali Çehreli:
> 
> > The code compiles under 32-bit (e.g. with the -m32 compiler switch) where size_t is an alias of uint.
> 
> Oh, I see. I compile most of the code on a 32 bit system.
> 
> I asked Walter to warn d programmers against such mistakes, and Walter closed it down. Someone else has opened the ER again...

That would be me. Let's see where it goes.

> Bye,
> bearophile

-- 
Marco

July 16, 2013
This entry has stopped working since lot of time:
http://rosettacode.org/wiki/MD5/Implementation#D

This is an improved version, but help is welcome:
http://codepad.org/g4RBio8E

Bye,
bearophile
July 17, 2013
> http://codepad.org/g4RBio8E

this line:
.replace("TT", "0x" ~ text(T(n), 16));

Needs to be:
.replace("TT", "0x" ~ to!string(T(n), 16));

But the code in that link is all wrong because it needs all the code from std.md5 to work.
And even then I don't know where Decode() is.

Bye,
bearophile
July 17, 2013
> But the code in that link is all wrong because it needs all the code from std.md5 to work.
> And even then I don't know where Decode() is.

OK, the code now works :-)

Bye,
bearophile
July 17, 2013
> OK, the code now works :-)

And the results are a bit hilarious:


...>md5_implementation5_dmd
md5  digest("")  = D41D8CD98F00B204E9800998ECF8427E
zmd5 digest("")  = D41D8CD98F00B204E9800998ECF8427E

Test performance / message size 200MBytes
digest(data) = F083432AB71F6177A8EC2CA5157F7B83
std.md5:    16.59 M/sec  (    12.05 secs)
digest(data) = F083432AB71F6177A8EC2CA5157F7B83
zmd5   :    81.90 M/sec  (     2.44 secs)



...>md5_implementation5_ldc
md5  digest("")  = D41D8CD98F00B204E9800998ECF8427E
zmd5 digest("")  = D41D8CD98F00B204E9800998ECF8427E

Test performance / message size 200MBytes
digest(data) = F083432AB71F6177A8EC2CA5157F7B83
std.md5:   112.36 M/sec  (     1.78 secs)
digest(data) = F083432AB71F6177A8EC2CA5157F7B83
zmd5   :    98.18 M/sec  (     2.04 secs)


The zmd5 version is generated asm with a small part in D. LDC2 compiles the standard D version even better... :-)

Bye,
bearophile
July 21, 2013
Now this D entry works again:
http://rosettacode.org/wiki/S-Expressions#D

Probably it can be written without explicit indexes, only using txt.front, txt.popFrontN, txt.find, etc. Do you want to produce such modified version?


This simple task shows well why a parser combinators like Parsec is better:
http://rosettacode.org/wiki/S-Expressions#Haskell

Bye,
bearophile