Re: D graph library

2013-05-08 Thread qznc
I am thinking about something like this as well, but finishing things is not my strength. ;) What I desired were probably quite different requirements to other graph libraries. My background is compiler optimizations, where the programs are represented as a graph: libFirm [0]. 1) A transaction

Re: static parameters

2013-05-08 Thread Daniel Murphy
""Luís Marques " <=?UTF-8?B?Ikx1w61z?= Marques > wrote in message news:vgdlzvqadnlmxtwni...@forum.dlang.org... > Are static parameters still planned for inclusion in the language? IIRC there are no plans to include these.

Re: Issue 3789 and some interesting pull requests

2013-05-08 Thread Dicebot
On Wednesday, 8 May 2013 at 03:03:16 UTC, bearophile wrote: ... Wow, lot of good stuff implemented and just waiting for approval. Impressive.

Re: Why extern variables and functions within template/struct/class have a D mangling

2013-05-08 Thread Andrej Mitrovic
On 5/7/13, Igor Stepanov wrote: > struct Foo > { >extern(C) void bar() >{ > >} > } > > Is it good to set bar mangling to "bar"? No. For one example, internal extern(C) functions can be used for callbacks. You wouldn't want linking to fail if you have this code: struct A { extern(

Re: Why extern variables and functions within template/struct/class have a D mangling

2013-05-08 Thread Dicebot
On Wednesday, 8 May 2013 at 09:09:34 UTC, Andrej Mitrovic wrote: ... Suck code is invalid in C++ and for a good reason. I'd really expect D to refuse to compile extern(C) functions it can't possibly mangle correctly.

Re: Why extern variables and functions within template/struct/class have a D mangling

2013-05-08 Thread Andrej Mitrovic
On 5/8/13, Dicebot wrote: > On Wednesday, 8 May 2013 at 09:09:34 UTC, Andrej Mitrovic wrote: >> ... > > Suck code is invalid in C++ and for a good reason. I'd really > expect D to refuse to compile extern(C) functions it can't > possibly mangle correctly. > Sorry, I forgot I was actually thinking

Re: Why extern variables and functions within template/struct/class have a D mangling

2013-05-08 Thread Dicebot
On Wednesday, 8 May 2013 at 09:22:52 UTC, Andrej Mitrovic wrote: On 5/8/13, Dicebot wrote: On Wednesday, 8 May 2013 at 09:09:34 UTC, Andrej Mitrovic wrote: ... Suck code is invalid in C++ and for a good reason. I'd really expect D to refuse to compile extern(C) functions it can't possibly ma

Re: Why extern variables and functions within template/struct/class have a D mangling

2013-05-08 Thread Andrej Mitrovic
On 5/8/13, Dicebot wrote: > static methods are illegal in C++ with extern(C) too. I don't see why. They're useful in D anyway.

Re: Why extern variables and functions within template/struct/class have a D mangling

2013-05-08 Thread Dicebot
On Wednesday, 8 May 2013 at 09:46:00 UTC, Andrej Mitrovic wrote: On 5/8/13, Dicebot wrote: static methods are illegal in C++ with extern(C) too. I don't see why. They're useful in D anyway. Because they have namespace (class namespace) and can't be mangled according to C rules. Exactly you

Re: Why extern variables and functions within template/struct/class have a D mangling

2013-05-08 Thread Andrej Mitrovic
On 5/8/13, Dicebot wrote: > Because they have namespace (class namespace) and can't be > mangled according to C rules. Exactly your example. You can't > have two "foo"'s there but any other naming scheme IS NOT C > mangling but some weird abomination that pretends to be it. Thus > it is a compile-

Re: Why extern variables and functions within template/struct/class have a D mangling

2013-05-08 Thread Dicebot
On Wednesday, 8 May 2013 at 09:56:14 UTC, Andrej Mitrovic wrote: On 5/8/13, Dicebot wrote: Because they have namespace (class namespace) and can't be mangled according to C rules. Exactly your example. You can't have two "foo"'s there but any other naming scheme IS NOT C mangling but some weird

Re: D graph library

2013-05-08 Thread Joseph Rushton Wakeling
On 05/08/2013 09:14 AM, qznc wrote: > I am thinking about something like this as well, but finishing things is > not my strength. ;) Oh, tell me about it. :-P > What I desired were probably quite different requirements to other graph > libraries. My background is compiler optimizations, where t

Re: Why extern variables and functions within template/struct/class have a D mangling

2013-05-08 Thread Andrej Mitrovic
On 5/8/13, Dicebot wrote: > Well, that is one of rather inconvenient issues with D handling > of emitting symbols (this one kind of inherited from C++). > extern(X) defines both mangling and calling convention. You can't > have those separately now. Yeah. I suppose the ideal situation would be t

Re: Why extern variables and functions within template/struct/class have a D mangling

2013-05-08 Thread Dicebot
On Wednesday, 8 May 2013 at 10:28:40 UTC, Andrej Mitrovic wrote: I suppose the ideal situation would be to have extern(C) follow strict C mangling and calling convention (meaning no mangling for nested extern(C) symbols), and have a separate linkage(C) feature to be used when we want to set the

Re: D graph library

2013-05-08 Thread Joseph Rushton Wakeling
On 05/06/2013 07:09 PM, H. S. Teoh wrote: > So what I envision as far as graph libraries in D are concerned is > something like the generic range API, where there is a fixed convention > as to what constitutes a graph/digraph/etc., and the library itself is a > template library that is able to hand

Re: About structs and performant handling

2013-05-08 Thread Namespace
On Saturday, 9 March 2013 at 23:07:50 UTC, Ali Çehreli wrote: On 03/09/2013 12:19 PM, Namespace wrote: > But structs with a bigger size aren't that performant if you pass them > as copy or move them (See also my small benchmark: I have started working on the DConf presentation about copy and m

Re: LDC and Debian

2013-05-08 Thread H. S. Teoh
On Wed, May 08, 2013 at 06:39:16AM +0100, Russel Winder wrote: > The Debian Freeze is over now that Wheezy is released, and stuff is > now filtering its way into Unstable making the use of Experimental > more as it should be. > > Now would be a good time to get a new LDC into Debian. And GDC too!

D pullrequest review process rant

2013-05-08 Thread Benjamin Thaut
I recently got very disappointed by the review process of a pull request I did on druntime: https://github.com/D-Programming-Language/druntime/pull/370 This is how it went: 1) First everyone nitpicked about code formatting 2) I fixed all the nitpicks which was quite some work. 3) Pull request

Re: LDC and Debian

2013-05-08 Thread Joseph Rushton Wakeling
On 05/08/2013 04:53 PM, H. S. Teoh wrote: > I can help sponsor GDC uploads if necessary. I may try to build it > myself, but I'm not sure if I have the time (or patience!) to babysit > through it (past experiences of building GCC/GDC were not that pleasant, > sad to say). Does Debian unstable/expe

Re: LDC and Debian

2013-05-08 Thread Iain Buclaw
On 8 May 2013 15:53, H. S. Teoh wrote: > On Wed, May 08, 2013 at 06:39:16AM +0100, Russel Winder wrote: > > The Debian Freeze is over now that Wheezy is released, and stuff is > > now filtering its way into Unstable making the use of Experimental > > more as it should be. > > > > Now would be a g

Re: D pullrequest review process rant

2013-05-08 Thread deadalnix
On Wednesday, 8 May 2013 at 14:56:23 UTC, Benjamin Thaut wrote: I recently got very disappointed by the review process of a pull request I did on druntime: https://github.com/D-Programming-Language/druntime/pull/370 This is how it went: 1) First everyone nitpicked about code formatting 2) I f

Re: LDC and Debian

2013-05-08 Thread Iain Buclaw
On 8 May 2013 16:04, Joseph Rushton Wakeling wrote: > On 05/08/2013 04:53 PM, H. S. Teoh wrote: > > I can help sponsor GDC uploads if necessary. I may try to build it > > myself, but I'm not sure if I have the time (or patience!) to babysit > > through it (past experiences of building GCC/GDC were

Re: D pullrequest review process rant

2013-05-08 Thread Dicebot
On Wednesday, 8 May 2013 at 14:56:23 UTC, Benjamin Thaut wrote: ... It is not publicly defined anywhere, pretty much as anything else about D _development_ process. People just come and make comments about stuff they notice. At some point someone with merge rights come and either highlight c

Re: D pullrequest review process rant

2013-05-08 Thread Joseph Rushton Wakeling
On 05/08/2013 04:56 PM, Benjamin Thaut wrote: > So what I'm trying to say is, that maybe a pull request should first be > analyzed > if it is actually worth putting more work into it before starting with the > nitpicks. I don't know if the review process is already defined somewhere, if > not it m

Re: D pullrequest review process rant

2013-05-08 Thread Benjamin Thaut
Am 08.05.2013 17:07, schrieb deadalnix: nit is important. When you read a lot of code, if the presentation is correct, it disappear and the content become apparent. Otherwise, it is much more work to get to the content. Many project simply reject code that is not formatted properly. Not kidding

Re: LDC and Debian

2013-05-08 Thread Joseph Rushton Wakeling
On 05/08/2013 05:10 PM, Iain Buclaw wrote: > I've already done this... see previous email for outstanding things to do. :-) You mean already sent a package? That's great news, thank you! :-)

Re: D graph library

2013-05-08 Thread Craig Dillabaugh
Then for nodes/vertices you'd want to define a number of properties: neighbours /* OK, OK, neighbors. Purely in order to save keystroke time for programmers. Returns a RandomAccessRange to the collection of nodes that the given node lin

Re: D graph library

2013-05-08 Thread Joseph Rushton Wakeling
On 05/08/2013 05:48 PM, Craig Dillabaugh wrote: > I wonder if it is a good idea to try and guarantee specific times > for operations like these in all case, or rather support multiple > back-end representations that make specific operations more or > less efficient. Then document the trade offs. Li

Re: D graph library

2013-05-08 Thread H. S. Teoh
On Wed, May 08, 2013 at 02:34:32PM +0200, Joseph Rushton Wakeling wrote: > On 05/06/2013 07:09 PM, H. S. Teoh wrote: > > So what I envision as far as graph libraries in D are concerned is > > something like the generic range API, where there is a fixed > > convention as to what constitutes a graph/

Re: I wrote a JSON library

2013-05-08 Thread deadalnix
On Tuesday, 7 May 2013 at 20:14:20 UTC, w0rp wrote: Per request for examples of my library, I have produced this little snippet. http://pastebin.com/sU8heFXZ It's hard to enumerate all of the features I put in there at once, but that's a pretty good start. I also listed a few examples in a doc

Re: D pullrequest review process rant

2013-05-08 Thread Timothee Cour
I agree with deadalnix, we need a dfmt tool to autoformat submissions. Then this problem goes away. uncrustify has support for D, we just need to write the options file that everyone agrees upon, or, even better, a custom tool. We could also automate the formatting part of the review process by run

Re: D pullrequest review process rant

2013-05-08 Thread Sean Kelly
On Wednesday, 8 May 2013 at 14:56:23 UTC, Benjamin Thaut wrote: I recently got very disappointed by the review process of a pull request I did on druntime: https://github.com/D-Programming-Language/druntime/pull/370 This is how it went: 1) First everyone nitpicked about code formatting 2) I f

Re: D graph library

2013-05-08 Thread Joseph Rushton Wakeling
On 05/08/2013 06:12 PM, H. S. Teoh wrote: > Hmm. Is it necessary to provide a random access ranges? For some graph > algorithms that's necessary, but for others, it may not be. Agree that it's debatable. It's probably desirable but not necessary. >> Note also that both the above automatically de

Re: About structs and performant handling

2013-05-08 Thread Ali Çehreli
On 05/08/2013 05:57 AM, Namespace wrote: > On Saturday, 9 March 2013 at 23:07:50 UTC, Ali Çehreli wrote: >> On 03/09/2013 12:19 PM, Namespace wrote: >> >> > But structs with a bigger size aren't that performant if you >> pass them >> > as copy or move them (See also my small benchmark: >> >> I ha

Re: D pullrequest review process rant

2013-05-08 Thread Nick Sabalausky
Personally, I find that good readability sometimes dictates selective exceptions to a codebase's usual style guidelines. That is, I find that code formatting rules are best used as general guideline or rules-of-thumb, rather than strict hard and fast rules. Automated formatting enforcement would ge

Re: D pullrequest review process rant

2013-05-08 Thread Jonathan M Davis
On Wednesday, May 08, 2013 14:08:10 Nick Sabalausky wrote: > Personally, I find that good readability sometimes dictates selective > exceptions to a codebase's usual style guidelines. That is, I find > that code formatting rules are best used as general guideline or > rules-of-thumb, rather than st

Re: Voldemort Types

2013-05-08 Thread Jonathan M Davis
On Wednesday, May 08, 2013 18:43:01 =?UTF-8?B?Ikx1w61z?=.Marques @puremagic.com wrote: > Hi, > > Regarding this article about Voldemort types: > > > http://www.drdobbs.com/cpp/voldemort-types-in-d/232901591?pgno=2 > > There's something I didn't understand. I general I understand the > benefit

Re: Why extern variables and functions within template/struct/class have a D mangling

2013-05-08 Thread Andrej Mitrovic
On 5/8/13, Dicebot wrote: > Well, pardon me, I probably have exceeded my allowed daily rant > limit :) Don't worry, and I agree with you. But I think it's probably too late to actually change what a linkage specifier does for nested symbols. We might end up getting duplicate symbol definition err

Re: I want to add a Phobos module with template mixins for common idioms.

2013-05-08 Thread Idan Arye
OK, so I'm gonna go ahead and implement it, so I can show by example that the string solution can be typesafe, scalable and elegant.

Re: About structs and performant handling

2013-05-08 Thread Namespace
I was wondering where I can find your benchmarks as I read your slides. Now it has become clearer. I'm looking forward to reading your benchmarks and assessments. :)

Re: Voldemort Types

2013-05-08 Thread Luís.Marques
On Wednesday, 8 May 2013 at 18:41:27 UTC, Jonathan M Davis wrote: It probably _should_ document that it's returning a range. Voldemort types just make it so that the exact type is unknown. So why not just declare "SomeRange generator()"? It still doesn't leak out the internal struct and any a

Re: I wrote a JSON library

2013-05-08 Thread w0rp
The API look really nice ! I'd love to sse something similar into phobos APIwise. But I don't like the shortcut choices. arr => array you only win 2 chars ! That is nothing and certainly not worth the confusion. Same for obj => object. With this kind of practices, everybody come with its own

Re: Voldemort Types

2013-05-08 Thread Dicebot
On Wednesday, 8 May 2013 at 20:46:55 UTC, Luís Marques wrote: On Wednesday, 8 May 2013 at 18:41:27 UTC, Jonathan M Davis wrote: It probably _should_ document that it's returning a range. Voldemort types just make it so that the exact type is unknown. So why not just declare "SomeRange generat

Singletons, alias this and DMD crashing

2013-05-08 Thread Leandro Motta Barros
Hello, I was toying with the idea of adding an 'alias instance this' to a low-lock singleton, to allow calling MySingleton.method(), instead of MySingleton.instance.method(). When I tried this, however, DMD 2.062 crashed. Under Linux, after chewing the code for a long time, it exits with "Error:

Re: Voldemort Types

2013-05-08 Thread Jonathan M Davis
On Wednesday, May 08, 2013 22:46:53 =?UTF-8?B?Ikx1w61z?=.Marques @puremagic.com wrote: > On Wednesday, 8 May 2013 at 18:41:27 UTC, Jonathan M Davis wrote: > > It probably _should_ document that it's returning a range. > > Voldemort types > > just make it so that the exact type is unknown. > > So

Re: Singletons, alias this and DMD crashing

2013-05-08 Thread Ali Çehreli
On 05/08/2013 02:20 PM, Leandro Motta Barros wrote: > When I tried this, however, DMD 2.062 crashed. The compiler gets stuck in a loop and allocates infinite memory. I tried it with a not-very-recent git version of dmd: v2.063-devel-f6d55a9-dirty The problem is fixed in that version. Ali

Re: Voldemort Types

2013-05-08 Thread H. S. Teoh
On Wed, May 08, 2013 at 05:45:35PM -0400, Jonathan M Davis wrote: > On Wednesday, May 08, 2013 22:46:53 =?UTF-8?B?Ikx1w61z?=.Marques > @puremagic.com wrote: > > On Wednesday, 8 May 2013 at 18:41:27 UTC, Jonathan M Davis wrote: > > > It probably _should_ document that it's returning a range. > > >

Re: dtutor.org: a call to action

2013-05-08 Thread Tyro[17]
On Sunday, 5 May 2013 at 22:08:59 UTC, Nathan M. Swan wrote: On Sunday, 5 May 2013 at 22:06:17 UTC, Nathan M. Swan wrote: On Sunday, 5 May 2013 at 19:37:02 UTC, Tyro[17] wrote: Like everyone, my time is limited, but I can help a bit. Sign me up! Andrew NMS I forgot, do you have a gith

Re: I wrote a JSON library

2013-05-08 Thread deadalnix
On Wednesday, 8 May 2013 at 21:05:55 UTC, w0rp wrote: The API look really nice ! I'd love to sse something similar into phobos APIwise. But I don't like the shortcut choices. arr => array you only win 2 chars ! That is nothing and certainly not worth the confusion. Same for obj => object. Wit

Re: D pullrequest review process rant

2013-05-08 Thread Timothee Cour
Can you point me to a few places in phobos where you worry the autoformatter will be undesirable ? We use something like clang_format on a large code base and it just works. For the rare cases where one wants to override the autoformatter, we can include a special tag in comments. The need for tho

Re: dtutor.org: a call to action

2013-05-08 Thread MIke Linford
On Sunday, 5 May 2013 at 19:37:02 UTC, Tyro[17] wrote: The main contributors of D are doing a wonderful job of enhancing the language. I can confidently say that we are leagues ahead of where we stood a just two years ago. But there has been a long cry for documentation that has gone unanswered

Re: DConf 2013 - what a show!

2013-05-08 Thread Manu
Just got home. I had a great time! I want to thank everyone involved again for the opportunity to attend and speak at dconf! :) Meeting everyone in the meat certainly is invaluable, and I like how I can now read the forum with faces, voices and accents. Looking forward to the next one! :P On 4

Re: DConf 2013 - what a show!

2013-05-08 Thread Mike Linford
On Saturday, 4 May 2013 at 08:11:21 UTC, Walter Bright wrote: I just arrived home after 4 days of little sleep and dawn to late night talking with fellow D-heads. And the conference was ... !!AWESOME!! .. It exceeded my highest hopes. Basically, I had a grand time, and I hope you guys did,

Re: The liabilities of binding rvalues to ref

2013-05-08 Thread Manu
On 7 May 2013 00:26, Andrei Alexandrescu wrote: > On 5/6/13 12:56 PM, Steven Schveighoffer wrote: > >> On Sat, 04 May 2013 22:49:42 -0700, Andrei Alexandrescu >> wrote: >> >> void fix(ref double x) { if (isnan(x)) x = 0; } >>> >> >> ... >> >> There may be other important patterns to address at

Re: Rvalue references - The resolution

2013-05-08 Thread Manu
On 5 May 2013 10:37, Andrei Alexandrescu wrote: > On 5/4/13 7:31 PM, Walter Bright wrote: > >> On 5/4/2013 3:51 PM, w0rp wrote: >> >>> Does all of this also mean that a >>> function with a ref parameter will automagically work with r-values? >>> >> >> Yes. >> > > This is new to me. My understandin

Re: D pullrequest review process rant

2013-05-08 Thread Martin Nowak
On 05/08/2013 05:07 PM, deadalnix wrote: When you read a lot of code, if the presentation is correct, it disappear and the content become apparent. Otherwise, it is much more work to get to the content. I know this is a problem, but seeing a lot of changed code which has a different style make