Guy Steele on language design

2010-01-20 Thread bearophile
The Coders at Work book written by Peter Seibel is a good collection of interview to famous programmers (some parts of the book are too much long and boring). In a chapter Guy Steele tells some of his ideas about designing a language. He is a good programmer, he has given a significant help in

Re: D Language 2.0

2010-01-20 Thread bearophile
Andrei Alexandrescu: With such a system in place, object.d can essentially gain entire control about an entire program's memory management policy. This is interesting, thank you for your answer. Today you have to design a language not just for what's good for the single programmer, and not

Re: unit type for addition to std lib [was Re: D Language 2.0]

2010-01-20 Thread Simen kjaeraas
On Wed, 20 Jan 2010 03:47:58 +0100, BCS n...@anon.com wrote: Hello SiegeLord, BCS Wrote: Also all of the imperial units that I don't care about, as well as the more obscure physical units. My lib has every SI unit I could fine and all the units I found that I recognised. The current

Re: unit type for addition to std lib [was Re: D Language 2.0]

2010-01-20 Thread Simen kjaeraas
On Wed, 20 Jan 2010 03:47:58 +0100, BCS n...@anon.com wrote: Hello SiegeLord, BCS Wrote: Also all of the imperial units that I don't care about, as well as the more obscure physical units. My lib has every SI unit I could fine and all the units I found that I recognised. The current

Re: Guy Steele on language design

2010-01-20 Thread Bane
bearophile Wrote: The Coders at Work book written by Peter Seibel is a good collection of interview to famous programmers (some parts of the book are too much long and boring). In a chapter Guy Steele tells some of his ideas about designing a language. He is a good programmer, he has given

Re: Guy Steele on language design

2010-01-20 Thread E. Normus Prong
Bane Wrote: bearophile Wrote: The Coders at Work book written by Peter Seibel is a good collection of interview to famous programmers (some parts of the book are too much long and boring). In a chapter Guy Steele tells some of his ideas about designing a language. He is a good

Re: Guy Steele on language design

2010-01-20 Thread Bane
E. Normus Prong Wrote: Bane Wrote: bearophile Wrote: The Coders at Work book written by Peter Seibel is a good collection of interview to famous programmers (some parts of the book are too much long and boring). In a chapter Guy Steele tells some of his ideas about

Re: D Language 2.0

2010-01-20 Thread retard
Tue, 19 Jan 2010 23:17:44 -0800, Andrei Alexandrescu wrote: Walter and I are very convinced that the approach based on rewriting/lowering is very promising. This sounds really good. I'm sure this could be extended to other built- in types as well.

Re: Guy Steele on language design

2010-01-20 Thread retard
Wed, 20 Jan 2010 06:29:47 -0500, Bane wrote: E. Normus Prong Wrote: Bane Wrote: Hm, Guy Steele sounds like porn actor name. Interesting article, dough. Leave Guy alone - we all have to make a living... So he's programming during day and acting over night? Man, that is perfect job!

Re: D Language 2.0

2010-01-20 Thread dennis luehring
Am 20.01.2010 12:42, schrieb retard: Tue, 19 Jan 2010 23:17:44 -0800, Andrei Alexandrescu wrote: Walter and I are very convinced that the approach based on rewriting/lowering is very promising. This sounds really good. I'm sure this could be extended to other built- in types as well. i

Re: D Language 2.0

2010-01-20 Thread
dennis luehring Wrote: Am 20.01.2010 12:42, schrieb retard: Tue, 19 Jan 2010 23:17:44 -0800, Andrei Alexandrescu wrote: Walter and I are very convinced that the approach based on rewriting/lowering is very promising. This sounds really good. I'm sure this could be extended to other

Re: D Language 2.0

2010-01-20 Thread Leandro Lucarella
bearophile, el 20 de enero a las 01:51 me escribiste: A better strategy is first of all to improve a lot the D GC Is not a better strategy, is another strategy. Improving the GC is as important as (or even more important than) having a -nogc option. But an extremely efficient GC will not be

Re: D Language 2.0

2010-01-20 Thread Leandro Lucarella
Andrei Alexandrescu, el 19 de enero a las 23:17 me escribiste: bearophile wrote: Andrei Alexandrescu: I'd love -nogc. Then we can think of designing parts of Phobos to work under that regime. But you must do this with lot of care: programmers coming from C++ will be tempted to write code

Re: D Language 2.0

2010-01-20 Thread Ben Hanson
dsimcha Wrote: == Quote from Jérôme_M._Berger (jeber...@free.fr)'s article PS: At work, we mustn't use C++ because: - It's slow; - Its standard library is too big (100k); - In a future product, we might want to reuse this module and not have C++ (Oh, yes I didn't tell you that we *do*

Re: Guy Steele on language design

2010-01-20 Thread Simen kjaeraas
Bane branimir.milosavlje...@gmail.com wrote: So he's programming during day and acting over night? Man, that is perfect job! Nonono. He's a programmer at night and actor during the day. How could anyone ever program while the sun is up? -- Simen

Re: D Language 2.0

2010-01-20 Thread Ben Hanson
By the way I forgot a link to 'Secure STL': http://channel9.msdn.com/shows/Going+Deep/STL-Iterator-Debugging-and-Secure-SCL/ 'nuff said. Regards, Ben

Re: unit type for addition to std lib [was Re: D Language 2.0]

2010-01-20 Thread SiegeLord
Simen kjaeraas Wrote: On Wed, 20 Jan 2010 03:47:58 +0100, BCS n...@anon.com wrote: Hello SiegeLord, BCS Wrote: Also all of the imperial units that I don't care about, as well as the more obscure physical units. My lib has every SI unit I could fine and all the units I found

Re: interesting iterator library

2010-01-20 Thread Jesse Phillips
Andrei Alexandrescu wrote: Interesting design. The interfaces map quite well to the issues addressed by ranges. http://www.php.net/~helly/php/ext/spl/ Andrei That is interesting, I like the 'RecursiveIteratorIterator Ranges seem so much simpler.

Re: D Language 2.0

2010-01-20 Thread Danny Wilson
On Wed, 20 Jan 2010 14:18:52 +0100, Leandro Lucarella llu...@gmail.com wrote: Again? RC is *not* -nogc, is -anothergc. And reference counting won't do the trick unless you add a backing GC to free cycles. What I mean about -nogc is *no* GC, is please, mr compiler, give me an error when a GC

Re: D Language 2.0

2010-01-20 Thread Adam D. Ruppe
On Wed, Jan 20, 2010 at 10:18:52AM -0300, Leandro Lucarella wrote: Walter and I talked for hours about a no-gc model for D, and the conclusion was that with only a little compiler support, things can be arranged such that swapping different object.d implementations, the entire D allocation

Re: unit type for addition to std lib [was Re: D Language 2.0]

2010-01-20 Thread SiegeLord
Actually, nevermind on the precision arguments, precision doesn't work like that. There may be other arguments for natural units that I can't think of now, though... -SiegeLord

Re: D Language 2.0

2010-01-20 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Again? RC is *not* -nogc, is -anothergc. I agree. With reference counting, you'd be no worse than a C++ project that decided to use refcounted smart pointers for all allocated objects. That sounds good to me. And reference counting won't do the trick unless you

Re: interesting iterator library

2010-01-20 Thread Andrei Alexandrescu
Jesse Phillips wrote: Andrei Alexandrescu wrote: Interesting design. The interfaces map quite well to the issues addressed by ranges. http://www.php.net/~helly/php/ext/spl/ Andrei That is interesting, I like the 'RecursiveIteratorIterator Ranges seem so much simpler. In fact the PHP

Re: D Language 2.0

2010-01-20 Thread Craig Black
Leandro Lucarella Wrote: Andrei Alexandrescu, el 19 de enero a las 23:17 me escribiste: bearophile wrote: Andrei Alexandrescu: I'd love -nogc. Then we can think of designing parts of Phobos to work under that regime. But you must do this with lot of care: programmers coming from C++

Re: D Language 2.0

2010-01-20 Thread Andrei Alexandrescu
Craig Black wrote: Leandro Lucarella Wrote: Andrei Alexandrescu, el 19 de enero a las 23:17 me escribiste: bearophile wrote: Andrei Alexandrescu: I'd love -nogc. Then we can think of designing parts of Phobos to work under that regime. But you must do this with lot of care: programmers

Re: unit type for addition to std lib [was Re: D Language 2.0]

2010-01-20 Thread BCS
Hello SiegeLord, Avogadro's number is not know precisely, and because of that very reason the unit of mole is used. It is not even known precisely enough to fill out the 15 digits of precision that double type provides, which just makes it unacceptable as a hard-coded constant (unlike say, pi).

Re: D Language 2.0

2010-01-20 Thread BCS
Hello bearophile, BCS: A better strategy is first of all to improve a lot the D GC, if That's true regardless :) I don't agree, because that idea of mine can be wrong :-) What I was saying is that first you improve the GC performance (if necessary modifying the language too) and you

Re: D Language 2.0

2010-01-20 Thread BCS
Hello Andrei, The nice part about refcounting is that for the most part you don't need to cripple the language. I think people are trying to say that disallowing use of GC stuff wouldn't cripple the language. Also there is one thing that -nogc would have over what you are talking about;

Re: D Language 2.0

2010-01-20 Thread Andrei Alexandrescu
BCS wrote: Hello Andrei, The nice part about refcounting is that for the most part you don't need to cripple the language. I think people are trying to say that disallowing use of GC stuff wouldn't cripple the language. Well it's a fact that there would be fewer idioms and options

Re: D Language 2.0

2010-01-20 Thread Leandro Lucarella
Danny Wilson, el 20 de enero a las 16:44 me escribiste: On Wed, 20 Jan 2010 14:18:52 +0100, Leandro Lucarella llu...@gmail.com wrote: Again? RC is *not* -nogc, is -anothergc. And reference counting won't do the trick unless you add a backing GC to free cycles. What I mean about -nogc is

Re: D Language 2.0

2010-01-20 Thread Leandro Lucarella
Andrei Alexandrescu, el 20 de enero a las 08:32 me escribiste: Leandro Lucarella wrote: Again? RC is *not* -nogc, is -anothergc. I agree. With reference counting, you'd be no worse than a C++ project that decided to use refcounted smart pointers for all allocated objects. That sounds good

Re: D Language 2.0

2010-01-20 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Danny Wilson, el 20 de enero a las 16:44 me escribiste: On Wed, 20 Jan 2010 14:18:52 +0100, Leandro Lucarella llu...@gmail.com wrote: Again? RC is *not* -nogc, is -anothergc. And reference counting won't do the trick unless you add a backing GC to free cycles. What I

Re: D Language 2.0

2010-01-20 Thread Craig Black
If you do this and use this style for a significant percentage (well, more than 10-15% of it, unless it's less than 5000 lines long) of your whole program, then you are using C++ in D, and I think it's better for you to avoid using D, and to use C++ or C or asm :-) No I think that even using

Re: D Language 2.0

2010-01-20 Thread Craig Black
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote in message news:hj7vnu$200...@digitalmars.com... BCS wrote: Hello Andrei, The nice part about refcounting is that for the most part you don't need to cripple the language. I think people are trying to say that disallowing use of GC

Re: D Language 2.0

2010-01-20 Thread Leandro Lucarella
Andrei Alexandrescu, el 20 de enero a las 17:39 me escribiste: Leandro Lucarella wrote: Danny Wilson, el 20 de enero a las 16:44 me escribiste: On Wed, 20 Jan 2010 14:18:52 +0100, Leandro Lucarella llu...@gmail.com wrote: Again? RC is *not* -nogc, is -anothergc. And reference counting won't

Re: D Language 2.0

2010-01-20 Thread Rainer Deyke
Leandro Lucarella wrote: But I don't think people that *really* need to be in full control would see a RC GC as something tempting. I don't need full control. I need RAII for dynamically allocated objects, with destructors that really work. C++ with reference counting can give me that and D

Re: D Language 2.0

2010-01-20 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 20 de enero a las 17:39 me escribiste: Leandro Lucarella wrote: Danny Wilson, el 20 de enero a las 16:44 me escribiste: On Wed, 20 Jan 2010 14:18:52 +0100, Leandro Lucarella llu...@gmail.com wrote: Again? RC is *not* -nogc, is -anothergc. And

Unsigned-related bugs never occur in real code.

2010-01-20 Thread Andrei Alexandrescu
It's an academic problem. Don't worry about it and move on. That's what Walter kept on telling me. Yet I've spent the better part of an hour reducing a bug down to the following: import std.math, std.stdio; void main() { auto a = [ 4, 4, 2, 3, 2 ]; float avgdist = 0; uint count;

Re: D Language 2.0

2010-01-20 Thread BCS
Hello Andrei, BCS wrote: Also there is one thing that -nogc would have over what you are talking about; you could use it on some modules and not others. If I have some performance critical code where attempting to use the GC would break it's perf contract, I can put it in it's own module and

Re: D Language 2.0

2010-01-20 Thread Andrei Alexandrescu
BCS wrote: Hello Andrei, BCS wrote: Also there is one thing that -nogc would have over what you are talking about; you could use it on some modules and not others. If I have some performance critical code where attempting to use the GC would break it's perf contract, I can put it in it's own

Re: D Language 2.0

2010-01-20 Thread BCS
Hello Andrei, It's reasonable to say that you decide at application design level what memory management approach you want to choose. That doesn't fragment the community. The decision is similar to many others made at the same level: libraries used, build flags, target platform(s), pointer size

Re: D Language 2.0

2010-01-20 Thread Andrei Alexandrescu
BCS wrote: Hello Andrei, It's reasonable to say that you decide at application design level what memory management approach you want to choose. That doesn't fragment the community. The decision is similar to many others made at the same level: libraries used, build flags, target platform(s),

Re: D Language 2.0

2010-01-20 Thread Michel Fortin
On 2010-01-20 23:43:58 -0500, BCS n...@anon.com said: Why would having one chunk of code get checked for calls to the GC and another not be any more complicated than mixing malloc/free+add/removeRoot with normal GC? I'm beginning to wonder if I'm calling for something different than other

Re: D Language 2.0

2010-01-20 Thread BCS
Hello Michel, Theoretically, I think you should be able to avoid GC calls in a function by using nothrow: void func() nothrow { auto a = new char[1]; // error: may throw } Unfortunately, it doesn't seem to always work: void func(string a, string b) nothrow { auto c = a ~ b; // no error? } But

Re: D Language 2.0

2010-01-20 Thread Andrei Alexandrescu
Michel Fortin wrote: On 2010-01-20 23:43:58 -0500, BCS n...@anon.com said: Why would having one chunk of code get checked for calls to the GC and another not be any more complicated than mixing malloc/free+add/removeRoot with normal GC? I'm beginning to wonder if I'm calling for something

Re: Why it doesn't compile in D 2.0?

2010-01-20 Thread Don
aarti_pl wrote: W dniu 2010-01-17 19:38, Don pisze: aarti_pl wrote: class Test { string t1 = test; //Ok! char[] t2 = test.dup; //Compile error } void main(char[][] args) { } Error: hello.d(3): Error: cannot evaluate _adDupT(( D12TypeInfo_Aya6__initZ),test) at compile time hello.d(3): Error:

Synchronized Linked List Traversal

2010-01-20 Thread Jonathan Crapuchettes
I'm working on a project that requires multi-threading and I am trying to grasp the best way to work with setting up a linked-list where multiple threads might try to be setting the next element in the list at the same time. What I really need to know is if this will work: Node!(T) child =

[Issue 3726] New: Assertion failure: 'fd fd-inferRetType' on line 81 in file 'mangle.c'

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3726 Summary: Assertion failure: 'fd fd-inferRetType' on line 81 in file 'mangle.c' Product: D Version: unspecified Platform: x86 OS/Version: Windows Status: NEW

[Issue 3726] Assertion failure: 'fd fd-inferRetType' on line 81 in file 'mangle.c'

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3726 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||ice-on-valid-code

[Issue 2510] provide a template instantiation backtrace when compile fails in a template

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2510 Don clugd...@yahoo.com.au changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 3687] Array operation slice times scalar tramples over memory

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3687 --- Comment #5 from Don clugd...@yahoo.com.au 2010-01-20 06:56:52 PST --- The original test case passes on D2, but here's a test case which fails on both D1 and D2. -- void main() { float[66] array; array[] = 0; array[64] = 42;

[Issue 3727] New: lots of deffering SomeStructName messages when compiling

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3727 Summary: lots of deffering SomeStructName messages when compiling Product: D Version: 2.039 Platform: Other OS/Version: Linux Status: NEW Severity:

[Issue 3725] Add united type to standard library

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3725 Witold Baryluk bary...@smp.if.uj.edu.pl changed: What|Removed |Added CC|

[Issue 3728] New: getOverloads and identifier traits

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3728 Summary: getOverloads and identifier traits Product: D Version: unspecified Platform: Other OS/Version: Windows Status: NEW Severity: critical Priority: P2

[Issue 3728] getOverloads and identifier traits

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3728 --- Comment #1 from Max Samukha samu...@voliacable.com 2010-01-20 09:09:47 PST --- Created an attachment (id=553) getOverloads, identifier traits -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are

[Issue 3728] getOverloads and identifier traits

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3728 Max Samukha samu...@voliacable.com changed: What|Removed |Added Severity|critical|enhancement --

[Issue 3728] getOverloads and identifier traits

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3728 Andrei Alexandrescu and...@metalanguage.com changed: What|Removed |Added CC|

[Issue 3728] getOverloads and identifier traits

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3728 Eldar Insafutdinov e.insafutdi...@gmail.com changed: What|Removed |Added CC|

[Issue 3726] Regression: ICE(mangle.c 81): struct forward reference with static this

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3726 Don clugd...@yahoo.com.au changed: What|Removed |Added Summary|Assertion failure: 'fd|Regression: ICE(mangle.c

[Issue 3728] getOverloads and identifier traits

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3728 --- Comment #4 from Max Samukha samu...@voliacable.com 2010-01-20 11:07:36 PST --- When implementing isStaticFunction, please make sure it returns true for any function that doesn't require a context pointer (even if there is no explicit

[Issue 3729] New: Can't define opEquals for immutable types

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3729 Summary: Can't define opEquals for immutable types Product: D Version: 2.039 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2

[Issue 3659] Too much exegesis on opEquals

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3659 Tomasz Sowiński tomeks...@gmail.com changed: What|Removed |Added CC|

[Issue 3723] Regression: forward referenced enum

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3723 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||patch --- Comment #2 from

[Issue 3730] New: Struct's explicit constructor can't initialize global variables

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3730 Summary: Struct's explicit constructor can't initialize global variables Product: D Version: 2.039 Platform: x86 OS/Version: Windows Status: NEW

[Issue 3731] New: Immutable class may be changed when inherits from mutable parent

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3731 Summary: Immutable class may be changed when inherits from mutable parent Product: D Version: 2.039 Platform: x86 OS/Version: Windows Status: NEW

[Issue 3730] Struct's explicit constructor can't initialize global variables

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3730 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||clugd...@yahoo.com.au ---

[Issue 3674] forward reference error with multiple overloads with same name

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3674 --- Comment #4 from Rainer Schuetze r.sagita...@gmx.de 2010-01-20 14:48:34 PST --- The current revision (342) now shows a different error, even with a slightly reduced test case: public class IQGraphicsItem { public QGraphicsObject

[Issue 3732] New: Not all COM interfaces inherit from IUnknown.

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3732 Summary: Not all COM interfaces inherit from IUnknown. Product: D Version: 2.037 Platform: x86 OS/Version: Windows Status: NEW Severity: minor Priority: P2

[Issue 1079] gdb: Dwarf Error: Cannot find DIE at 0xb705 referenced from DIE at 0x250

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1079 --- Comment #15 from Bernard Helyer blood.of.l...@gmail.com 2010-01-20 20:53:25 PST --- This seems to have something to do with arrays (or manifests itself when they are present): [test]$ cat nolist.d void main() { int i = 0;

[Issue 1079] gdb: Dwarf Error: Cannot find DIE at 0xb705 referenced from DIE at 0x250

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1079 --- Comment #16 from Bernard Helyer blood.of.l...@gmail.com 2010-01-20 20:55:48 PST --- Oh! The above were simply compiled like so: dmd -g list.d dmd -g nolist.d -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email

[Issue 1079] gdb: Dwarf Error: Cannot find DIE at 0xb705 referenced from DIE at 0x250

2010-01-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1079 --- Comment #17 from Bernard Helyer blood.of.l...@gmail.com 2010-01-20 21:17:42 PST --- Compiling with `-gc` allows gdb to debug it (but not interact with AA or DAs, of course). This is with a patched gdb, though. Perhaps the bug lies in the