Rust vs Dlang

Russel Winder russel at winder.org.uk
Sun Mar 17 00:20:59 PDT 2013


On Sat, 2013-03-16 at 21:06 -0400, Andrei Alexandrescu wrote:
> On 3/16/13 10:42 AM, Suliman wrote:
> > Hi folks! I had wrote small article about Rust vs D. I hope that you
> > will like it!
> >
> > http://versusit.org/rust-vs-d
> 
> Nice writeup. Could you please fix the code formatting? Indentation is 
> lost at least on Chrome and Firefox on OSX. Then I'll be glad to post on 
> reddit.

Sorry I forgot to add:

Can either of the codes calculate:

	factorial(40)

?

i.e. are the codes at all relevant given that 32-bit and 64-bit integers
are useless for this calculation?

Python happily and correctly calculates factorial(2000).

Also if a functional approach is being advertised why use an imperative
algorithm for factorial, with it's explicit iteration, why not use
reduce so as to hide the itertation. In D:

	reduce!"a * b"(1L, iota(1, n+1)(

It appears the 1L is needed here when using ulongs or type inference
fails :-(
-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20130317/d3d269ef/attachment.pgp>


More information about the Digitalmars-d-announce mailing list