Jump to page: 1 24  
Page
Thread overview
Look and think good things about D
Nov 15, 2013
bearophile
Nov 15, 2013
Rob T
Nov 15, 2013
bearophile
Nov 15, 2013
bearophile
Nov 15, 2013
Kai Nacke
Nov 15, 2013
bearophile
Nov 15, 2013
bearophile
Nov 15, 2013
Martin Nowak
Nov 15, 2013
Meta
Nov 15, 2013
bearophile
Nov 15, 2013
qznc
Nov 15, 2013
bearophile
Nov 15, 2013
Jacob Carlborg
Nov 15, 2013
bearophile
Nov 15, 2013
Ary Borenszweig
Nov 15, 2013
bearophile
Nov 15, 2013
Chris
Nov 15, 2013
Jacob Carlborg
Nov 15, 2013
Ary Borenszweig
Nov 15, 2013
Chris
Nov 15, 2013
Ary Borenszweig
Nov 15, 2013
Chris
Nov 15, 2013
Ary Borenszweig
Nov 15, 2013
bearophile
Nov 15, 2013
Ary Borenszweig
Nov 15, 2013
bearophile
Nov 15, 2013
bearophile
Nov 17, 2013
SomeDude
Nov 17, 2013
bearophile
Nov 15, 2013
Marco Leise
Nov 17, 2013
SomeDude
Nov 17, 2013
bearophile
Nov 17, 2013
bearophile
November 15, 2013
I have created two interesting D entries for this Rosettacode Task, is someone willing to create a Reddit entry for this? They show very different kinds of code in D.

http://rosettacode.org/wiki/Look-and-say_sequence#D

Bye,
bearophile
November 15, 2013
On Friday, 15 November 2013 at 01:09:53 UTC, bearophile wrote:
> I have created two interesting D entries for this Rosettacode Task, is someone willing to create a Reddit entry for this? They show very different kinds of code in D.
>
> http://rosettacode.org/wiki/Look-and-say_sequence#D
>
> Bye,
> bearophile

>> Using the LDC2 compiler with n=70 the run-time is about 3.74 seconds.

Timings for short functional version vs fast would be nice.

--rt
November 15, 2013
On 11/15/2013 02:09 AM, bearophile wrote:
> I have created two interesting D entries for this Rosettacode Task

len.uninitializedArray ? Isn't this too much UFCS?
November 15, 2013
Rob T:

> Timings for short functional version vs fast would be nice.

OK. On the other hand regarding speed the fast version is in another world. So the speed comparison will become a little silly.

--------------

Martin Nowak:

> len.uninitializedArray ? Isn't this too much UFCS?

I think it's just enough of UFCS.

Bye,
bearophile
November 15, 2013
> OK. On the other hand regarding speed the fast version is in another world. So the speed comparison will become a little silly.

The first program doesn't even compile with ldc2 v.2.063.2, and the two programs are quite different in scope...

Bye,
bearophile
November 15, 2013
Rob T:

> Timings for short functional version vs fast would be nice.

Below the two I have added a note to compare the run-times.

Bye,
bearophile
November 15, 2013
On Friday, 15 November 2013 at 01:09:53 UTC, bearophile wrote:
> I have created two interesting D entries for this Rosettacode Task, is someone willing to create a Reddit entry for this? They show very different kinds of code in D.
>
> http://rosettacode.org/wiki/Look-and-say_sequence#D
>
> Bye,
> bearophile

I didn't look that closely at the imperative code, but it seems to be quite a bit longer than most of the other imperative examples. Is this because it's super-optimized?
November 15, 2013
Meta:

> I didn't look that closely at the imperative code, but it seems to be quite a bit longer than most of the other imperative examples. Is this because it's super-optimized?

Yes, it's longer because it's optimized.

Bye,
bearophile
November 15, 2013
On Friday, 15 November 2013 at 01:09:53 UTC, bearophile wrote:
> I have created two interesting D entries for this Rosettacode Task, is someone willing to create a Reddit entry for this? They show very different kinds of code in D.
>
> http://rosettacode.org/wiki/Look-and-say_sequence#D

The fast version is nearly functional, too. Since memory management is not considered a side effect there is only the printfs. If the printfs are wrapped into "debug", the function is pure.

November 15, 2013
On 2013-11-15 02:09, bearophile wrote:
> I have created two interesting D entries for this Rosettacode Task, is
> someone willing to create a Reddit entry for this? They show very
> different kinds of code in D.
>
> http://rosettacode.org/wiki/Look-and-say_sequence#D

What does this show, that ranges is slow in D?

-- 
/Jacob Carlborg
« First   ‹ Prev
1 2 3 4