Re: A summary of D's design principles

2010-09-28 Thread Juanjo Alvarez
On Mon, 27 Sep 2010 21:28:16 -0700, Walter Bright wrote: be found to tout it, it will be ineffective. This is because everyone touts their language as "more productive". People just see "more productive" and their brain just skips over it without it even entering their conscious thought. W

Re: [contest] Is a Cow an animal ++

2010-09-28 Thread Simen kjaeraas
bearophile wrote: Simen kjaeraas: Here's mine ( 8/11 at compile-time, the remaining at runtime ): http://ideone.com/6WlFJ Thank you. It's a nice implementation, and it doesn't use template magic at all, it's fully OOP :-) Your implementation shows that there are many different ways to s

Re: [contest] Is a Cow an animal ++

2010-09-28 Thread Simen kjaeraas
Mike Linford wrote: A random question about your naming scheme: What does the 'w' stand for in front of all your class names? 'What'. :P Honestly, I just saw everything being an 'object' and, that name being taken, added a random letter to its front. -- Simen

Re: [contest] Is a Cow an animal ++

2010-09-28 Thread retard
Mon, 27 Sep 2010 22:06:18 -0400, bearophile wrote: > Simen kjaeraas: >> Here's mine ( 8/11 at compile-time, the remaining at runtime ): >> http://ideone.com/6WlFJ > > Thank you. It's a nice implementation, and it doesn't use template magic > at all, it's fully OOP :-) Your implementation shows th

Re: A summary of D's design principles

2010-09-28 Thread Jesse Phillips
Juanjo Alvarez Wrote: > On Mon, 27 Sep 2010 21:28:16 -0700, Walter Bright > wrote: > > be found to tout it, it will be ineffective. This is because > everyone touts > > their language as "more productive". People just see "more > productive" and their > > brain just skips over it without it

Fedora 14 will integrate D into the distribution

2010-09-28 Thread Paulo Pinto
Hi, it seems that Fedora will provide D out of the box in their distribution. But they seem to be providing an old version of it. https://fedoraproject.org/wiki/Features/D_Programming Cheers, Paulo

Re: Fedora 14 will integrate D into the distribution

2010-09-28 Thread klickverbot
On 9/28/10 5:37 PM, Paulo Pinto wrote: Hi, it seems that Fedora will provide D out of the box in their distribution. But they seem to be providing an old version of it. https://fedoraproject.org/wiki/Features/D_Programming Cheers, Paulo Well, as far as I can tell, it's not exactly an old

Re: Fedora 14 will integrate D into the distribution

2010-09-28 Thread Michael Chen
Somebody should say something to them to use D 2.0 instead. On Tue, Sep 28, 2010 at 11:37 PM, Paulo Pinto wrote: > Hi, > > it seems that Fedora will provide D out of the box in their distribution. > > But they seem to be providing an old version of it. > > https://fedoraproject.org/wiki/Features/

Re: Fedora 14 will integrate D into the distribution

2010-09-28 Thread Robert Clipsham
On 28/09/10 16:52, Michael Chen wrote: Somebody should say something to them to use D 2.0 instead. D2 doesn't have an open source compiler, so it can't be included in the main repositories for Fedora. -- Robert http://octarineparrot.com/

Re: A summary of D's design principles

2010-09-28 Thread bearophile
Jesse Phillips: > This is exactly how it should be marketed. It has the productivity > of Python, other dynamic languages, with the performance and power > of a natively compiled language. Most programmers are able to see that's very false, today. The main and maybe only advantage of D over C# i

Re: A summary of D's design principles

2010-09-28 Thread Jesse Phillips
bearophile Wrote: > Jesse Phillips: > > > This is exactly how it should be marketed. It has the productivity > > of Python, other dynamic languages, with the performance and power > > of a natively compiled language. > > Most programmers are able to see that's very false, today. > > The main an

Switch implementation

2010-09-28 Thread bearophile
Through Reddit I have found a small article about reverse engineering the switch statement: http://www.codeproject.com/KB/cpp/switch.aspx I have compiled a test program with GCC and then with DMD with minimal changes, this is the D program and the asm from the two compilers: import std.c.stdio

Re: A summary of D's design principles

2010-09-28 Thread Jonathan M Davis
On Tuesday, September 28, 2010 10:22:09 bearophile wrote: > Jesse Phillips: > > This is exactly how it should be marketed. It has the productivity > > of Python, other dynamic languages, with the performance and power > > of a natively compiled language. > > Most programmers are able to see that's

Re: A summary of D's design principles

2010-09-28 Thread Juanjo Alvarez
On Tue, 28 Sep 2010 13:22:09 -0400, bearophile wrote: The main and maybe only advantage of D over C# is that it's multi-platform. But today the Web is very important, and D can't be used in browers. And performance, (most of the time) . And memory usage.

Re: A summary of D's design principles

2010-09-28 Thread Adam D. Ruppe
On Tue, Sep 28, 2010 at 01:34:07PM -0400, Jesse Phillips wrote: > I agree that much more time and work must go into it, especially a good > working selection of libraries. But for the most part it does deliver what I > described but not in all areas, e.g. web. What do you think is lacking for th

Re: Fedora 14 will integrate D into the distribution

2010-09-28 Thread SiegeLord
Paulo Pinto Wrote: > But they seem to be providing an old version of it. The stable version, you mean. -SiegeLord

Re: A summary of D's design principles

2010-09-28 Thread dsimcha
== Quote from Juanjo Alvarez (f...@fakeemail.com)'s article > On Tue, 28 Sep 2010 13:22:09 -0400, bearophile > wrote: > > The main and maybe only advantage of D over C# is that it's > multi-platform. But today the Web is very important, and D can't be > used in browers. > And performance, (most of

Re: A summary of D's design principles

2010-09-28 Thread bearophile
dsimcha: > And metaprogramming. In C# you are able to create and compile programs at runtime. And if you take a look at the Google C++ style guide you see that for a representative group of programmers the metaprogramming capabilities are a negative thing :-) Bye, bearophile

Re: Switch implementation

2010-09-28 Thread Pelle
On 09/28/2010 07:33 PM, bearophile wrote: Through Reddit I have found a small article about reverse engineering the switch statement: http://www.codeproject.com/KB/cpp/switch.aspx I have compiled a test program with GCC and then with DMD with minimal changes, this is the D program and the asm

Re: A summary of D's design principles

2010-09-28 Thread Jesse Phillips
bearophile Wrote: > dsimcha: > > And metaprogramming. > > In C# you are able to create and compile programs at runtime. > And if you take a look at the Google C++ style guide you see that for a > representative group of programmers the metaprogramming capabilities are a > negative thing :-) >

Re: A summary of D's design principles

2010-09-28 Thread retard
Tue, 28 Sep 2010 13:22:09 -0400, bearophile wrote: > Jesse Phillips: > >> This is exactly how it should be marketed. It has the productivity of >> Python, other dynamic languages, with the performance and power of a >> natively compiled language. > > Most programmers are able to see that's very f

Re: A summary of D's design principles

2010-09-28 Thread Jonathan M Davis
On Tuesday 28 September 2010 12:36:32 retard wrote: > Tue, 28 Sep 2010 13:22:09 -0400, bearophile wrote: > > Jesse Phillips: > >> This is exactly how it should be marketed. It has the productivity of > >> Python, other dynamic languages, with the performance and power of a > >> natively compiled la

Re: [contest] Is a Cow an animal ++

2010-09-28 Thread Philippe Sigaud
I forgot to post my version yesterday: http://ideone.com/rvwiN I chose to use static typing and templates. Compiling it with IDEone gives the first 8 tests in the 'compilation info' box. Philippe

Re: A summary of D's design principles

2010-09-28 Thread Steven Schveighoffer
On Tue, 28 Sep 2010 15:36:32 -0400, retard wrote: Tue, 28 Sep 2010 13:22:09 -0400, bearophile wrote: Jesse Phillips: This is exactly how it should be marketed. It has the productivity of Python, other dynamic languages, with the performance and power of a natively compiled language. Most p

Re: A summary of D's design principles

2010-09-28 Thread piotrek
On Tue, 28 Sep 2010 13:22:09 -0400, bearophile wrote: > Jesse Phillips: > >> This is exactly how it should be marketed. It has the productivity of >> Python, other dynamic languages, with the performance and power of a >> natively compiled language. > > Most programmers are able to see that's ve

Re: A summary of D's design principles

2010-09-28 Thread Walter Bright
bearophile wrote: In C# you are able to create and compile programs at runtime. Any language can do that. And if you take a look at the Google C++ style guide you see that for a representative group of programmers the metaprogramming capabilities are a negative thing :-) I'd be careful not

Re: [BUG} dsss linker error when a module has @property

2010-09-28 Thread Nick Sabalausky
"Adam Cigánek" wrote in message news:mailman.336.1285626348.858.digitalmar...@puremagic.com... > Hello there, > > Could someone take a look at this bug: > http://www.dsource.org/projects/dsss/ticket/234 ? Or at least point me > the right way - I might give a try fixing it myself. > > adam. DSSS

Re: A summary of D's design principles

2010-09-28 Thread Jesse Phillips
Steven Schveighoffer Wrote: > On Tue, 28 Sep 2010 15:36:32 -0400, retard wrote: > > > That's pretty awesome. You have maybe 0.001% of the libraries directly > > available, a buggy compiler, no 64-bit support, no formal spec etc. etc. > > And still you get about 70% of the productivity. And people

Re: A summary of D's design principles

2010-09-28 Thread Juanjo Alvarez
On Tue, 28 Sep 2010 19:36:32 + (UTC), retard wrote: That's pretty awesome. You have maybe 0.001% of the libraries directly I have a lot more libraries in D than in Python. In C. [bla bla bla, bad sarcasms, bla bla bla] at least 100 times more productive than with Python. You can write

Re: A summary of D's design principles

2010-09-28 Thread Juanjo Alvarez
On Tue, 28 Sep 2010 19:36:32 + (UTC), retard wrote: other languages. However, please consider that C# is *higher* level language than D and that means it by definition has better portability to multiple platforms. You already have a C# virtual machine for all major LOL. I've never been

Re: A summary of D's design principles

2010-09-28 Thread bearophile
Walter Bright: > > In C# you are able to create and compile programs at runtime. > > Any language can do that. I meant that in modern dotnet C# the compiler is a library, you import it, you have a human API to build an AST and then you are able to compile and run it. The 'compiler as library'

Re: A summary of D's design principles

2010-09-28 Thread retard
Tue, 28 Sep 2010 16:20:27 -0400, Steven Schveighoffer wrote: > And you are still posting on this NG because...? The amount of religious stupidity never fails to impress me. I've never seen a community with this badly brainwashed zealots.

Re: A summary of D's design principles

2010-09-28 Thread retard
Tue, 28 Sep 2010 16:20:27 -0400, Steven Schveighoffer wrote: > On Tue, 28 Sep 2010 15:36:32 -0400, retard wrote: > >> Tue, 28 Sep 2010 13:22:09 -0400, bearophile wrote: >>> Jesse Phillips: >>> This is exactly how it should be marketed. It has the productivity of Python, other dynamic l

Re: Switch implementation

2010-09-28 Thread Iain Buclaw
== Quote from Pelle (pelle.mans...@gmail.com)'s article > On 09/28/2010 07:33 PM, bearophile wrote: > > Through Reddit I have found a small article about reverse engineering the switch statement: > > http://www.codeproject.com/KB/cpp/switch.aspx > > > > I have compiled a test program with GCC and t

Re: Switch implementation

2010-09-28 Thread bearophile
Iain Buclaw: > Out of curiousity, I thought I might give a good stress test a try. You are mostly testing compiler speed, while my worry was about runtime. I didn't even know DMD is able to digest switch statements with more than 256 cases. I have opened an enhancement request, add a comment to

Re: Switch implementation

2010-09-28 Thread Iain Buclaw
== Quote from bearophile (bearophileh...@lycos.com)'s article > Iain Buclaw: > > Out of curiousity, I thought I might give a good stress test a try. > You are mostly testing compiler speed, while my worry was about runtime. I didn't even know DMD is able to digest switch statements with more than 2

Re: Switch implementation

2010-09-28 Thread retard
Tue, 28 Sep 2010 13:33:16 -0400, bearophile wrote: > Through Reddit I have found a small article about reverse engineering > the switch statement: http://www.codeproject.com/KB/cpp/switch.aspx > > I have compiled a test program with GCC and then with DMD with minimal > changes, this is the D prog

Re: Switch implementation

2010-09-28 Thread Jonathan M Davis
On Tuesday, September 28, 2010 15:46:01 Iain Buclaw wrote: > Out of curiousity, I thought I might give a good stress test a try. > > Specs of my machine: > > Samsung N110, 2.1GHz Intel Atom, 2GB Memory. > > Code looks like this: It's a switch statement with 20,000 cases. The real question thoug

Re: A summary of D's design principles

2010-09-28 Thread Andrei Alexandrescu
On 9/28/10 14:32 PDT, retard wrote: Tue, 28 Sep 2010 16:20:27 -0400, Steven Schveighoffer wrote: And you are still posting on this NG because...? The amount of religious stupidity never fails to impress me. I've never seen a community with this badly brainwashed zealots. That only begs the

Re: Fedora 14 will integrate D into the distribution

2010-09-28 Thread bioinfornatics
Hi, I am the the fedora packager, in official repo we use ldc as compiler because fedora want promote only open source project. It not an old version, ldc works fine for D1 and in this repo http://blog.fedora-fr.org/bioinfornatics/post/Repo-for-D-programming They are a ldc compiler and tango bri

Re: Switch implementation

2010-09-28 Thread bearophile
Iain Buclaw: > Oh, it was my *original* intention to test runtime speed. However, the time to > compile just stood out little more like a sore thumb than what I anticipated. If your purpose is to test runtime speed, use a more natural number of cases like 10 or 20 or even 50 :-) So I have done

Re: Switch implementation

2010-09-28 Thread bearophile
retard: > Instead of O(n) linear search or O(ln n) binary search, why not use O(1) > jump tables in this case? I don't exactly know. But you must take into account the constants too, it's not just a matter of worst-case computational complexity. Probably when the density of a large jump table

Re: Switch implementation

2010-09-28 Thread bioinfornatics
with ldc and tango (up to date) $ ldc -O5 -release -enable-inlining test.d $ time ./test 150 130 49720 real0m4.376s user0m4.373s sys 0m0.001s D Code import tango.stdc.stdio: printf; int NLOOPS = 10; int c1, c2, c3; void f1() { c

Re: Switch implementation

2010-09-28 Thread bioinfornatics
I have a AMD Phenom(tm) II X4 955 Processor and this script works only on one core of my quad (800Mhz)

Re: Switch implementation

2010-09-28 Thread bearophile
bioinfornatics: > with ldc and tango (up to date) > $ ldc -O5 -release -enable-inlining test.d > $ time ./test > 150 130 49720 > > real 0m4.376s > user 0m4.373s > sys 0m0.001s LDC has llvm back-end, that doesn't share that dmd problem. But to give us meaningful data, I suggest yo

Re: Switch implementation

2010-09-28 Thread Iain Buclaw
== Quote from bearophile (bearophileh...@lycos.com)'s article > Iain Buclaw: > > Oh, it was my *original* intention to test runtime speed. However, the time > > to > > compile just stood out little more like a sore thumb than what I > > anticipated. > If your purpose is to test runtime speed, use

Re: Switch implementation

2010-09-28 Thread Robert Jacques
On Tue, 28 Sep 2010 20:45:27 -0400, bearophile wrote: retard: Instead of O(n) linear search or O(ln n) binary search, why not use O(1) jump tables in this case? I don't exactly know. But you must take into account the constants too, it's not just a matter of worst-case computational com

Re: Switch implementation

2010-09-28 Thread bearophile
Robert Jacques: > Well there are 28 labeled cases and ~16kb of jump table address space. > (32kb on 64-bit platforms) 32 kb are enough to fill the code part of the L1 cache on most CPUs. Bye, bearophile

Re: Switch implementation

2010-09-28 Thread bearophile
Iain Buclaw: > gdc-4.4 -O3 -fno-jump-tables > real 0m7.136s > user 0m7.112s > sys 0m0.008s ... > gdc-4.4 -O3 -funroll-loops -fno-jump-tables > real 0m7.237s > user 0m7.184s > sys 0m0.044s > > Differences are pretty minimal... Probably because gcc/gdc is not using a jump table here, but a

Re: A summary of D's design principles

2010-09-28 Thread BCS
Hello Walter, bearophile wrote: In C# you are able to create and compile programs at runtime. Any language can do that. And if you take a look at the Google C++ style guide you see that for a representative group of programmers the metaprogramming capabilities are a negative thing :-) I'd

Re: Switch implementation

2010-09-28 Thread retard
Tue, 28 Sep 2010 22:00:06 -0400, bearophile wrote: > Robert Jacques: >> Well there are 28 labeled cases and ~16kb of jump table address space. >> (32kb on 64-bit platforms) > > 32 kb are enough to fill the code part of the L1 cache on most CPUs. 28 cases and 32 kB of space seems like a waste. I'

Re: Fedora 14 will integrate D into the distribution

2010-09-28 Thread Andrei Alexandrescu
On 9/28/10 16:41 PDT, bioinfornatics wrote: Hi, I am the the fedora packager, in official repo we use ldc as compiler because fedora want promote only open source project. It not an old version, ldc works fine for D1 and in this repo http://blog.fedora-fr.org/bioinfornatics/post/Repo-for-D-pro

Re: [contest] Is a Cow an animal ++

2010-09-28 Thread Mike Linford
On Tue, 28 Sep 2010 14:56:33 +0200, Simen kjaeraas wrote: > Mike Linford wrote: > >> A random question about your naming scheme: What does the 'w' stand for >> in front of all your class names? > > 'What'. :P Honestly, I just saw everything being an 'object' and, that > name being taken, added