Re: Implementing and optimizing a simple graph metric

2013-09-24 Thread Joseph Rushton Wakeling
On Wednesday, 18 September 2013 at 13:39:29 UTC, bearophile wrote: auto centrality = minimallyInitializedArray!(typeof(return))(g.vertexCount); centrality[] = T0; auto stack = new size_t[g.vertexCount]; auto sigma = minimallyInitializedArray!T(g.vertexCount); sigma[] = T0;

Re: DUnit: Advanced unit testing toolkit.

2013-09-24 Thread linkrope
On Monday, 23 September 2013 at 16:40:56 UTC, jostly wrote: I think it's great to see the D unit testing ecosystem growing. Since it's still relatively small, I think we have a good chance here to create interoperability between the different frameworks. As I see it, we have: 1. Running

Re: DUnit: Advanced unit testing toolkit.

2013-09-24 Thread linkrope
Same hint as for specd: have a look at 'assertOp'! http://d.puremagic.com/issues/show_bug.cgi?id=4653 alias assertOp! assertGreaterThan; alias assertOp!= assertGreaterThanOrEqual; alias assertOp! assertLessThan; alias assertOp!= assertLessThanOrEqual; avoids duplicate code. Maybe, you can do

Re: Implementing and optimizing a simple graph metric

2013-09-24 Thread bearophile
Joseph Rushton Wakeling: As an experiment I tried something along these lines -- using uninitializedArray for most of the arrays here and minimallyInitializedArray for p. minimallyInitializedArray is not stupid, if the specified type has no indirections, it's equivalent to using

Re: std.allocator needs your help

2013-09-24 Thread Manu
On 24 September 2013 15:31, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 9/23/13 9:56 PM, Manu wrote: You can't go wasting GPU memory by overallocating every block. Only the larger chunk may need to be overallocated if all allocations are then rounded up. I don't follow.

Re: Debugging support for D - wiki

2013-09-24 Thread Rainer Schuetze
On 23.09.2013 21:50, Bruno Medeiros wrote: For DMD+Windows, is there only good debugger support with VisualD? :-( And how well does that work with 32/64 bit platform variations? Current options that I know of for Windows: - DMD/Win32+windbg(1996): This is a version of windbg from 1996 with

Re: Debugging support for D - wiki

2013-09-24 Thread Jacob Carlborg
On 2013-09-23 21:50, Bruno Medeiros wrote: (what about Mac though?) The sate of debugging on Mac OS X is worse than on Linux. There are a couple of problems: * D symbols need to be prefixed with an extra underscore * The GDB system debugger is very old. It doesn't have the D patches the

Re: std.allocator needs your help

2013-09-24 Thread Jacob Carlborg
On 2013-09-23 19:53, Andrei Alexandrescu wrote: I talked Walter's ear off a while ago at an ACCU conference about the notion that reference counting could be a switch passed to the compiler. Recently he's authored a DIP about the compiler inserting refcounting primitives in the generated code.

Re: std.allocator needs your help

2013-09-24 Thread Jacob Carlborg
On 2013-09-24 02:03, H. S. Teoh wrote: I thought Walter's DIP already addresses the issue of replacing the default allocator? http://wiki.dlang.org/DIP46 I get the feeling that we don't have a good handle on the fundamental issues, though. Having a stack for managing the default

Re: std.allocator needs your help

2013-09-24 Thread Jacob Carlborg
On 2013-09-23 22:32, Timon Gehr wrote: Some general remarks: One issue you will probably run into and maybe want to fix in some way during the typed allocator design is that private constructors cannot be called from templates parameterized on types. E.g.: module a; auto New(T,Args...)(Args

Re: compiled code file size

2013-09-24 Thread Iain Buclaw
On Sep 20, 2013 5:40 PM, Temtaime temta...@gmail.com wrote: DMD likes the size. When compiling, compiler may use GBs of RAM. In resulting executable there is no dead/unused code elimination. Three random sentences that are not at all factual. :) Regards -- Iain Buclaw *(p e ? p++ : p) =

Re: std.allocator needs your help

2013-09-24 Thread Dmitry Olshansky
23-Sep-2013 03:49, Andrei Alexandrescu пишет: Hello, I am making good progress on the design of std.allocator, and I am optimistic about the way it turns out. D's introspection capabilities really shine through, and in places the design does feel really archetypal - e.g. this is the essence of

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-24 Thread Timon Gehr
On 09/23/2013 02:08 PM, renoX wrote: On Friday, 20 September 2013 at 15:23:20 UTC, Paulo Pinto wrote: Am 20.09.2013 16:24, schrieb renoX: That said, he made the same mistake as Haskell's authors: currying is a *mathematical detail* which shouldn't obscure function type: 'f: a-b-c' is less

Re: Will Java go native?

2013-09-24 Thread Chris
On Friday, 20 September 2013 at 05:23:15 UTC, Dmitry Leskov wrote: On Thursday, 19 September 2013 at 09:44:30 UTC, Chris wrote: Yes, the whole issue of decompilation was also an issue. Funnily enough, a few years ago I wrote an email to Excelsior asking if you guys offer a discount for

Re: [OT] Which IDE / Editor do you use?

2013-09-24 Thread Dicebot
On Monday, 23 September 2013 at 23:42:39 UTC, Timon Gehr wrote: I have never figured out how to even get it into that state, but it might have been lack of motivation. I had to work under Windows a while last year. Yeah, one week I simply went into stubborn I want to make it work rampage and

Re: std.allocator needs your help

2013-09-24 Thread Robert
On Mon, 2013-09-23 at 10:53 -0700, Andrei Alexandrescu wrote: void deallocate(void[] buffer); This is because the size of D objects is naturally known: classes have it in the classinfo, slices store it, and the few cases of using bald pointers for allocation are irrelevant and

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-24 Thread renoX
On Tuesday, 24 September 2013 at 09:15:37 UTC, Timon Gehr wrote: On 09/23/2013 02:08 PM, renoX wrote: On Friday, 20 September 2013 at 15:23:20 UTC, Paulo Pinto wrote: Am 20.09.2013 16:24, schrieb renoX: That said, he made the same mistake as Haskell's authors: currying is a *mathematical

Re: std.allocator needs your help

2013-09-24 Thread Dan Schatzberg
One thing I'm not sure is addressed by this design is memory locality. I know of libnuma http://linux.die.net/man/3/numa which allows me to express what NUMA domain my memory should be allocated from at run-time for each allocation. In the case that I want to allocate memory in a specific

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-24 Thread Max Samukha
On Tuesday, 24 September 2013 at 11:32:18 UTC, renoX wrote: On Tuesday, 24 September 2013 at 09:15:37 UTC, Timon Gehr wrote: On 09/23/2013 02:08 PM, renoX wrote: On Friday, 20 September 2013 at 15:23:20 UTC, Paulo Pinto wrote: Am 20.09.2013 16:24, schrieb renoX: That said, he made the same

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-24 Thread Szymon Gatner
On Tuesday, 24 September 2013 at 12:06:22 UTC, Max Samukha wrote: A 'normal' function in Haskell takes exactly one object and returns exactly one object. a - b - c is actually a - (b - c) because - is right-associative. It's perfectly readable for people in the Haskell subculture. You'll

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-24 Thread deadalnix
On Tuesday, 24 September 2013 at 11:32:18 UTC, renoX wrote: I'm not sure you understood my point: a 'normal' function takes inputS and produce an output, in the notation: a,b-c you can clearly see the inputS and the output with a minimum of 'syntax noise' around them. In the notation a - b -

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-24 Thread Max Samukha
On Tuesday, 24 September 2013 at 12:09:28 UTC, Szymon Gatner wrote: On Tuesday, 24 September 2013 at 12:06:22 UTC, Max Samukha wrote: A 'normal' function in Haskell takes exactly one object and returns exactly one object. a - b - c is actually a - (b - c) because - is right-associative. It's

Re: std.allocator needs your help

2013-09-24 Thread deadalnix
On Tuesday, 24 September 2013 at 11:38:29 UTC, Dan Schatzberg wrote: One thing I'm not sure is addressed by this design is memory locality. I know of libnuma http://linux.die.net/man/3/numa which allows me to express what NUMA domain my memory should be allocated from at run-time for each

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-24 Thread Joseph Rushton Wakeling
On 20/09/13 20:53, H. S. Teoh wrote: Sad to say, I encountered a good number of Phobos bugs caused by the conflation between built-in arrays and ranges. Code would inadvertently assume array behaviour on ranges, and break when you pass in a non-array range. Some of these have been fixed; I'm

Re: Debugging support for D - wiki

2013-09-24 Thread Wyatt
On Monday, 23 September 2013 at 22:57:27 UTC, Iain Buclaw wrote: GDB doesn't understand D mangling. We currently leverage the use of setting pretty-print names for debugging purposes, but you require to put the names in 'quotation.marks' - I will fix this sometime this year... maybe. :)

Re: Debugging support for D - wiki

2013-09-24 Thread eles
On Monday, 23 September 2013 at 23:45:12 UTC, eles wrote: On Monday, 23 September 2013 at 19:50:35 UTC, Bruno Medeiros wrote: OTOG, simple quetsion: how to install/update DDT plugin to the git HEAD version? Found that. Could you, please, tag the different releaseed versions, it is helpful

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-24 Thread renoX
On Tuesday, 24 September 2013 at 13:04:10 UTC, deadalnix wrote: On Tuesday, 24 September 2013 at 11:32:18 UTC, renoX wrote: I'm not sure you understood my point: a 'normal' function takes inputS and produce an output, in the notation: a,b-c you can clearly see the inputS and the output with a

Re: std.allocator needs your help

2013-09-24 Thread Dan Schatzberg
On Tuesday, 24 September 2013 at 13:21:48 UTC, deadalnix wrote: On Tuesday, 24 September 2013 at 11:38:29 UTC, Dan Schatzberg wrote: One thing I'm not sure is addressed by this design is memory locality. I know of libnuma http://linux.die.net/man/3/numa which allows me to express what NUMA

Re: Debugging support for D - wiki

2013-09-24 Thread Iain Buclaw
On 24 September 2013 14:31, Wyatt wyatt@gmail.com wrote: On Monday, 23 September 2013 at 22:57:27 UTC, Iain Buclaw wrote: GDB doesn't understand D mangling. We currently leverage the use of setting pretty-print names for debugging purposes, but you require to put the names in

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-24 Thread Max Samukha
On Tuesday, 24 September 2013 at 13:46:16 UTC, renoX wrote: On Tuesday, 24 September 2013 at 13:04:10 UTC, deadalnix wrote: On Tuesday, 24 September 2013 at 11:32:18 UTC, renoX wrote: I'm not sure you understood my point: a 'normal' function takes inputS and produce an output, in the notation:

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-24 Thread renoX
On Tuesday, 24 September 2013 at 14:15:12 UTC, Max Samukha wrote: [cut] I think that - is neither unnecessary nor noise. After having played with Haskell for a while, I actually find the syntax of D unnecessarily redundant. Oh, D is hardly a good example for syntax! Better than C++ doesn't

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/23/13 11:06 PM, Manu wrote: On 24 September 2013 15:31, Andrei Alexandrescu seewebsiteforem...@erdani.org mailto:seewebsiteforem...@erdani.org wrote: On 9/23/13 9:56 PM, Manu wrote: You can't go wasting GPU memory by overallocating every block. Only the larger chunk may

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/23/13 11:32 PM, Jacob Carlborg wrote: On 2013-09-23 19:53, Andrei Alexandrescu wrote: I talked Walter's ear off a while ago at an ACCU conference about the notion that reference counting could be a switch passed to the compiler. Recently he's authored a DIP about the compiler inserting

Re: Bartosz Milewski seems to like D more than C++ now :)

2013-09-24 Thread Max Samukha
On Tuesday, 24 September 2013 at 14:24:48 UTC, renoX wrote: On Tuesday, 24 September 2013 at 14:15:12 UTC, Max Samukha wrote: [cut] I think that - is neither unnecessary nor noise. After having played with Haskell for a while, I actually find the syntax of D unnecessarily redundant. Oh, D

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 1:46 AM, Dmitry Olshansky wrote: 23-Sep-2013 03:49, Andrei Alexandrescu пишет: Looks good (s/ubyte[]/void[] per current discussion). Changed. Do you imagine Typed allocators as something more then adapters that simplify a common pattern of allocate + emplace / destroy +

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 2:49 AM, Robert wrote: On Mon, 2013-09-23 at 10:53 -0700, Andrei Alexandrescu wrote: void deallocate(void[] buffer); This is because the size of D objects is naturally known: classes have it in the classinfo, slices store it, and the few cases of using bald pointers for allocation

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 4:38 AM, Dan Schatzberg wrote: One thing I'm not sure is addressed by this design is memory locality. I know of libnuma http://linux.die.net/man/3/numa which allows me to express what NUMA domain my memory should be allocated from at run-time for each allocation. In the case that I

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 9:12 AM, Paulo Pinto wrote: Am 24.09.2013 17:29, schrieb Andrei Alexandrescu: On 9/23/13 11:32 PM, Jacob Carlborg wrote: On 2013-09-23 19:53, Andrei Alexandrescu wrote: I think this is debatable. For one, languages such as Java and C++ still have built-in new but quite

Re: std.allocator needs your help

2013-09-24 Thread Paulo Pinto
Am 24.09.2013 17:29, schrieb Andrei Alexandrescu: On 9/23/13 11:32 PM, Jacob Carlborg wrote: On 2013-09-23 19:53, Andrei Alexandrescu wrote: I think this is debatable. For one, languages such as Java and C++ still have built-in new but quite ubiquitously unrecommend their usage in user code.

Re: std.allocator needs your help

2013-09-24 Thread Brad Anderson
On Tuesday, 24 September 2013 at 08:46:36 UTC, Dmitry Olshansky wrote: 23-Sep-2013 03:49, Andrei Alexandrescu пишет: Hello, I am making good progress on the design of std.allocator, and I am optimistic about the way it turns out. D's introspection capabilities really shine through, and in

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 9:39 AM, Brad Anderson wrote: Somewhat related: http://probablydance.com/2013/05/13/4gb-per-vector/ Great insight, long scroll. Please trim quoting appropriately. Andrei

Re: std.allocator needs your help

2013-09-24 Thread Paulo Pinto
Am 24.09.2013 18:14, schrieb Andrei Alexandrescu: On 9/24/13 9:12 AM, Paulo Pinto wrote: Am 24.09.2013 17:29, schrieb Andrei Alexandrescu: On 9/23/13 11:32 PM, Jacob Carlborg wrote: On 2013-09-23 19:53, Andrei Alexandrescu wrote: I think this is debatable. For one, languages such as Java

Re: std.allocator needs your help

2013-09-24 Thread Peter Alexander
On Tuesday, 24 September 2013 at 15:25:11 UTC, Andrei Alexandrescu wrote: What are they paying exactly? An extra arg to allocate that can probably be defaulted? void[] allocate(size_t bytes, size_t align = this.alignment) shared; For allocating relatively small objects (say up to 32K),

Re: Range interface for std.serialization

2013-09-24 Thread Jacob Carlborg
On 2013-08-28 13:20, Dmitry Olshansky wrote: Bumping this thread. Taking into account that you've settled on keeping Serializers as classes just finalize all methods of a concrete serializer that is templated on archiver (and make it a final class). Should be as simple as: class Serializer {

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 9:58 AM, Peter Alexander wrote: On Tuesday, 24 September 2013 at 15:25:11 UTC, Andrei Alexandrescu wrote: What are they paying exactly? An extra arg to allocate that can probably be defaulted? void[] allocate(size_t bytes, size_t align = this.alignment) shared; For allocating

Re: std.allocator needs your help

2013-09-24 Thread Dicebot
On Tuesday, 24 September 2013 at 16:58:27 UTC, Peter Alexander wrote: The cost of a few cycles really doesn't matter for memory allocation... If you are really allocating memory so frequently that those few extra cycles matter then you are probably going to be memory bound anyway. It is true

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 10:05 AM, Dicebot wrote: On Tuesday, 24 September 2013 at 16:58:27 UTC, Peter Alexander wrote: The cost of a few cycles really doesn't matter for memory allocation... If you are really allocating memory so frequently that those few extra cycles matter then you are probably going to

Re: Debugging support for D - wiki

2013-09-24 Thread Joseph Rushton Wakeling
On 24/09/13 00:57, Iain Buclaw wrote: GDB doesn't understand D mangling. We currently leverage the use of setting pretty-print names for debugging purposes, but you require to put the names in 'quotation.marks' - I will fix this sometime this year... maybe. :) When I asked about the

Re: Move VisualD to github/d-programming-language ?

2013-09-24 Thread Andrei Alexandrescu
On 9/22/13 7:05 AM, Rainer Schuetze wrote: On 21.09.2013 13:06, Andrei Alexandrescu wrote: On 9/21/13 3:04 AM, SomeDude wrote: On Saturday, 7 September 2013 at 19:26:11 UTC, Peter Alexander wrote: On Saturday, 7 September 2013 at 19:05:03 UTC, Walter Bright wrote: Recent threads here have

Re: Debugging support for D - wiki

2013-09-24 Thread Iain Buclaw
On 24 September 2013 18:19, Joseph Rushton Wakeling joseph.wakel...@webdrake.net wrote: On 24/09/13 00:57, Iain Buclaw wrote: GDB doesn't understand D mangling. We currently leverage the use of setting pretty-print names for debugging purposes, but you require to put the names in

Re: std.allocator needs your help

2013-09-24 Thread Dan Schatzberg
On Tuesday, 24 September 2013 at 16:06:39 UTC, Andrei Alexandrescu wrote: On 9/24/13 4:38 AM, Dan Schatzberg wrote: One thing I'm not sure is addressed by this design is memory locality. I know of libnuma http://linux.die.net/man/3/numa which allows me to express what NUMA domain my memory

Re: std.allocator needs your help

2013-09-24 Thread Peter Alexander
On Tuesday, 24 September 2013 at 17:02:18 UTC, Andrei Alexandrescu wrote: On 9/24/13 9:58 AM, Peter Alexander wrote: On Tuesday, 24 September 2013 at 15:25:11 UTC, Andrei Alexandrescu wrote: What are they paying exactly? An extra arg to allocate that can probably be defaulted? void[]

Re: Debugging support for D - wiki

2013-09-24 Thread Joseph Rushton Wakeling
On 24/09/13 19:28, Iain Buclaw wrote: ... are we talking about the same mangling issue here? What dmd does is not the same as gdc... :) I wondered if you'd inherited something from the frontend ... :-)

Re: Move VisualD to github/d-programming-language ?

2013-09-24 Thread Rainer Schuetze
On 24.09.2013 19:16, Andrei Alexandrescu wrote: On 9/22/13 7:05 AM, Rainer Schuetze wrote: On 21.09.2013 13:06, Andrei Alexandrescu wrote: Preapproved. Looking forward to the appropriate pull request. Rainer? Andrei I have created pull requests

Re: std.allocator needs your help

2013-09-24 Thread Dan Schatzberg
On Tuesday, 24 September 2013 at 17:38:34 UTC, Dan Schatzberg wrote: What is your objective though? Aren't you trying to define a hierarchy of allocators where more specific allocators can be composed from general ones? In which case what is the concern with including locality at the base

Re: std.allocator needs your help

2013-09-24 Thread Rainer Schuetze
On 24.09.2013 10:46, Dmitry Olshansky wrote: * expand(b, minDelta, maxDelta) grows b's length by at least minDelta (and on a best-effort basis by at least maxDelta) and returns true, or does nothing and returns false. In most allocators this should be @safe. (One key insight is that expand()

Re: std.allocator needs your help

2013-09-24 Thread Bigsandwich
Hi, I mostly just lurk around here, but occasionally I just can't resist putting in my two cents. I really want to see D replace C++ for AAA games (my industry) and allocators are really critical to that. I think there's an elephant here that most of the posts have been dancing around.

Re: Move VisualD to github/d-programming-language ?

2013-09-24 Thread Kapps
On Tuesday, 24 September 2013 at 18:19:26 UTC, Rainer Schuetze wrote: Regarding the installer: Visual D should be built with a precise GC, but that's currently only possible with a patched compiler and runtime. I'll have to provide the binaries somehow, but I think git isn't appropriate to do

Re: std.allocator needs your help

2013-09-24 Thread Dmitry Olshansky
24-Sep-2013 22:28, Rainer Schuetze пишет: On 24.09.2013 10:46, Dmitry Olshansky wrote: * expand(b, minDelta, maxDelta) grows b's length by at least minDelta (and on a best-effort basis by at least maxDelta) and returns true, or does nothing and returns false. In most allocators this should

Re: Debugging support for D - wiki

2013-09-24 Thread Iain Buclaw
On 24 September 2013 19:14, Joseph Rushton Wakeling joseph.wakel...@webdrake.net wrote: On 24/09/13 19:28, Iain Buclaw wrote: ... are we talking about the same mangling issue here? What dmd does is not the same as gdc... :) I wondered if you'd inherited something from the frontend ... :-)

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 11:02 AM, Peter Alexander wrote: On Tuesday, 24 September 2013 at 17:02:18 UTC, Andrei Alexandrescu wrote: On 9/24/13 9:58 AM, Peter Alexander wrote: On Tuesday, 24 September 2013 at 15:25:11 UTC, Andrei Alexandrescu wrote: What are they paying exactly? An extra arg to allocate

Re: Move VisualD to github/d-programming-language ?

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 11:19 AM, Rainer Schuetze wrote: On 24.09.2013 19:16, Andrei Alexandrescu wrote: On 9/22/13 7:05 AM, Rainer Schuetze wrote: Should we add links to Mono-D and DDT aswell? I think so. Ok, will add these. Bruno and Alex, is it ok for you? What are the appropriate links? Are

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 11:28 AM, Rainer Schuetze wrote: On 24.09.2013 10:46, Dmitry Olshansky wrote: * expand(b, minDelta, maxDelta) grows b's length by at least minDelta (and on a best-effort basis by at least maxDelta) and returns true, or does nothing and returns false. In most allocators this

Re: std.allocator needs your help

2013-09-24 Thread Dmitry Olshansky
24-Sep-2013 23:36, Andrei Alexandrescu пишет: On 9/24/13 11:28 AM, Rainer Schuetze wrote: [snip] which causes confusion - people will pass small sizes to expand() expecting it to contract, something that expand() can't support as a matter of principle (safety!!!). Showstopper. It has to

Re: std.allocator needs your help

2013-09-24 Thread Dmitry Olshansky
24-Sep-2013 20:48, Andrei Alexandrescu пишет: On 9/24/13 9:39 AM, Brad Anderson wrote: Somewhat related: http://probablydance.com/2013/05/13/4gb-per-vector/ Great insight, long scroll. Please trim quoting appropriately. Andrei In fact one may have both deque (just start in the middle) and

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 12:47 PM, Dmitry Olshansky wrote: 24-Sep-2013 23:36, Andrei Alexandrescu пишет: On 9/24/13 11:28 AM, Rainer Schuetze wrote: [snip] which causes confusion - people will pass small sizes to expand() expecting it to contract, something that expand() can't support as a matter of

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 12:49 PM, Andrei Alexandrescu wrote: On 9/24/13 12:47 PM, Dmitry Olshansky wrote: 24-Sep-2013 23:36, Andrei Alexandrescu пишет: On 9/24/13 11:28 AM, Rainer Schuetze wrote: [snip] which causes confusion - people will pass small sizes to expand() expecting it to contract,

Re: std.allocator needs your help

2013-09-24 Thread Dmitry Olshansky
24-Sep-2013 19:56, Andrei Alexandrescu пишет: On 9/24/13 1:46 AM, Dmitry Olshansky wrote: 23-Sep-2013 03:49, Andrei Alexandrescu пишет: Do you imagine Typed allocators as something more then adapters that simplify a common pattern of allocate + emplace / destroy + deallocate?

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Walter Bright
On 9/23/2013 10:29 AM, Sean Kelly wrote: On Sep 21, 2013, at 10:22 PM, Walter Bright newshou...@digitalmars.com wrote: I'm not rejecting the idea outright. I've actually implemented this in the dmc compiler. It's just not terribly useful, and it has costs. I'd consider it in a similar class

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 11:20 AM, Dan Schatzberg wrote: On Tuesday, 24 September 2013 at 17:38:34 UTC, Dan Schatzberg wrote: What is your objective though? Aren't you trying to define a hierarchy of allocators where more specific allocators can be composed from general ones? In which case what is the

Re: Range interface for std.serialization

2013-09-24 Thread Dmitry Olshansky
24-Sep-2013 21:02, Jacob Carlborg пишет: On 2013-08-28 13:20, Dmitry Olshansky wrote: Taking into account that you've settled on keeping Serializers as classes just finalize all methods of a concrete serializer that is templated on archiver (and make it a final class). Should be as simple as:

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Walter Bright
On 9/23/2013 11:38 AM, bearophile wrote: 2) The other improvement I'd like for D error messages and warnings is to give a standard error number. This is a simple improvement, but it makes simpler to write explanation pages for the errors. The C# compiler and other compilers have them. I used

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Walter Bright
On 9/23/2013 10:33 AM, Iain Buclaw wrote: GCC has a carat too now. DMC has had a carat for 30 years now. int x x; ^ test2.c(2) : Error: missing ',' between declaration of 'x' and 'x' Nobody ever gave a damn about that feature, i.e. not one single person commented on it,

Re: Move VisualD to github/d-programming-language ?

2013-09-24 Thread simendsjo
On Tuesday, 24 September 2013 at 18:19:26 UTC, Rainer Schuetze wrote: On 24.09.2013 19:16, Andrei Alexandrescu wrote: On 9/22/13 7:05 AM, Rainer Schuetze wrote: On 21.09.2013 13:06, Andrei Alexandrescu wrote: Preapproved. Looking forward to the appropriate pull request. Rainer? Andrei

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 1:02 PM, Dmitry Olshansky wrote: 24-Sep-2013 19:56, Andrei Alexandrescu пишет: It could, but as I mentioned to Manu - at this level any cost is significant. Even changing from a compile-time constant to a global static dynamically-initialized constant has a cost. Making alignment an

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Walter Bright
On 9/23/2013 12:07 PM, Andrej Mitrovic wrote: On 9/23/13, bearophile bearophileh...@lycos.com wrote: 1) One of them is the aka, that is showing both the name of aliases and the aliased types/values: http://d.puremagic.com/issues/show_bug.cgi?id=5004 I have a partial implementation of this in

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Walter Bright
On 9/23/2013 12:19 PM, Timon Gehr wrote: There is no such thing as a law that obliges compiler writers to add column numbers in debug info when such information is available in frontend error messages. I guarantee that if the error messages have column numbers, people will file bug reports

Re: std.allocator needs your help

2013-09-24 Thread Rainer Schuetze
On 24.09.2013 21:36, Andrei Alexandrescu wrote: On 9/24/13 11:28 AM, Rainer Schuetze wrote: expand is nice, but I don't like minDelta and maxDelta as arguments. On a shared allocator this can lead to undesired side-effects, i.e. when this function is called concurrently on the same block by

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 2:02 PM, Rainer Schuetze wrote: On 24.09.2013 21:36, Andrei Alexandrescu wrote: On 9/24/13 11:28 AM, Rainer Schuetze wrote: expand is nice, but I don't like minDelta and maxDelta as arguments. On a shared allocator this can lead to undesired side-effects, i.e. when this function

Re: Move VisualD to github/d-programming-language ?

2013-09-24 Thread Rainer Schuetze
On 24.09.2013 21:31, Andrei Alexandrescu wrote: On 9/24/13 11:19 AM, Rainer Schuetze wrote: On 24.09.2013 19:16, Andrei Alexandrescu wrote: On 9/22/13 7:05 AM, Rainer Schuetze wrote: Should we add links to Mono-D and DDT aswell? I think so. Ok, will add these. Bruno and Alex, is it

Re: Move VisualD to github/d-programming-language ?

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 2:13 PM, Rainer Schuetze wrote: One big issue with it is correct RTInfo generation. I've made an attempt to fix the compiler ( https://github.com/D-Programming-Language/dmd/pull/2480 ), but that didn't get any reviews so far. Druntime patches are here:

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread David Nadlinger
On Tuesday, 24 September 2013 at 20:26:54 UTC, Walter Bright wrote: On 9/23/2013 10:33 AM, Iain Buclaw wrote: GCC has a carat too now. DMC has had a carat for 30 years now. int x x; ^ test2.c(2) : Error: missing ',' between declaration of 'x' and 'x' Nobody ever gave a damn

Re: std.allocator needs your help

2013-09-24 Thread Rainer Schuetze
On 24.09.2013 23:05, Andrei Alexandrescu wrote: Taking the current array implementation as an example, the deltas are computed before the actual GC lock happens inside gc_extend which means that the second of two concurrent requests leads to overallocation. (I'm confused - which array

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Andrej Mitrovic
On 9/24/13, Walter Bright newshou...@digitalmars.com wrote: Nobody ever gave a damn about that feature, i.e. not one single person commented on it, including not a single D user. It seems nobody comments on almost anything DMC-related anyway. Isn't this the DMC newsgroup:

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Andrej Mitrovic
On 9/24/13, David Nadlinger c...@klickverbot.at wrote: Maybe that's because not one single person actually uses DMC? ;) It's like building a bridge in the middle of Siberia and then saying that bridges are useless because hardly a dozen people use it a week.

Re: std.allocator needs your help

2013-09-24 Thread Nick Sabalausky
On Tue, 24 Sep 2013 08:29:39 -0700 Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 9/23/13 11:32 PM, Jacob Carlborg wrote: On 2013-09-23 19:53, Andrei Alexandrescu wrote: I think this is debatable. For one, languages such as Java and C++ still have built-in new but quite

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Andrej Mitrovic
On 9/24/13, Walter Bright newshou...@digitalmars.com wrote: I worry that this is too complicated to be worthwhile. Unfortunately yes, the way the compiler is written right now would mean the feature would have to be implemented as a series of hacks. Perhaps if the implementation simplifies or we

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread bearophile
Walter Bright: I worry that this is too complicated to be worthwhile. After seeing the error messages given by Clang I think it could be worthwhile. In C++ it has saved me debugging time. I used to do that, but again, it was a completely unwanted feature, and I abandoned it. It's simple

Re: std.allocator needs your help

2013-09-24 Thread Namespace
I would rather want new to be overloadable and have 2 sets of parameters new (allocator)(arg1, arg2) Where allocator would go to the overloaded version of new and arg1 and arg2 will be passed to the constructor. +1

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread bearophile
Andrej Mitrovic: Unfortunately yes, the way the compiler is written right now would mean the feature would have to be implemented as a series of hacks. Perhaps if the implementation simplifies or we get another compiler.. :) You could show somewhere what are the implementation

Re: std.allocator needs your help

2013-09-24 Thread jerro
Also, how does it work with your deallocate interface? Suppose I request an 0x100 aligned block of 0x100 bytes. Your alignment allocator requests 0x200 from the GC, which maybe returns [0x0040-0x0240] and then returns an aligned buffer from that [0x0100-0x0200]. Later, I try to

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Timon Gehr
On 09/24/2013 10:48 PM, Walter Bright wrote: On 9/23/2013 12:19 PM, Timon Gehr wrote: There is no such thing as a law that obliges compiler writers to add column numbers in debug info when such information is available in frontend error messages. I guarantee that if the error messages have

Re: std.allocator needs your help

2013-09-24 Thread Dmitry Olshansky
25-Sep-2013 01:05, Andrei Alexandrescu пишет: On 9/24/13 2:02 PM, Rainer Schuetze wrote: [snip] Why would you expect a function expand to reduce the memory size? Ask Dmitry :o). Far as I can tell he assumed so. I had read it as reallocate in place. Yeah, my semantic reading must suck

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Timon Gehr
On 09/24/2013 10:26 PM, Walter Bright wrote: On 9/23/2013 10:33 AM, Iain Buclaw wrote: GCC has a carat too now. DMC has had a carat for 30 years now. int x x; ^ test2.c(2) : Error: missing ',' between declaration of 'x' and 'x' Nobody ever gave a damn about that feature, i.e.

Re: std.allocator needs your help

2013-09-24 Thread Andrei Alexandrescu
On 9/24/13 3:11 PM, Namespace wrote: I would rather want new to be overloadable and have 2 sets of parameters new (allocator)(arg1, arg2) Where allocator would go to the overloaded version of new and arg1 and arg2 will be passed to the constructor. +1 We're banning that syntax of new.

Re: std.allocator needs your help

2013-09-24 Thread Dmitry Olshansky
25-Sep-2013 00:39, Andrei Alexandrescu пишет: On 9/24/13 1:02 PM, Dmitry Olshansky wrote: 24-Sep-2013 19:56, Andrei Alexandrescu пишет: It could, but as I mentioned to Manu - at this level any cost is significant. Even changing from a compile-time constant to a global static

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Peter Williams
On 25/09/13 06:29, Walter Bright wrote: On 9/23/2013 11:38 AM, bearophile wrote: 2) The other improvement I'd like for D error messages and warnings is to give a standard error number. This is a simple improvement, but it makes simpler to write explanation pages for the errors. The C# compiler

Re: Move VisualD to github/d-programming-language ?

2013-09-24 Thread Dicebot
On Tuesday, 24 September 2013 at 20:32:51 UTC, simendsjo wrote: On Tuesday, 24 September 2013 at 18:19:26 UTC, Rainer Schuetze wrote: On 24.09.2013 19:16, Andrei Alexandrescu wrote: On 9/22/13 7:05 AM, Rainer Schuetze wrote: On 21.09.2013 13:06, Andrei Alexandrescu wrote: Preapproved.

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Walter Bright
On 9/24/2013 2:23 PM, David Nadlinger wrote: On Tuesday, 24 September 2013 at 20:26:54 UTC, Walter Bright wrote: On 9/23/2013 10:33 AM, Iain Buclaw wrote: GCC has a carat too now. DMC has had a carat for 30 years now. int x x; ^ test2.c(2) : Error: missing ',' between

Re: D2 is really that stable as it is claimed to be?

2013-09-24 Thread Walter Bright
On 9/24/2013 2:56 PM, Andrej Mitrovic wrote: It seems nobody comments on almost anything DMC-related anyway. Isn't this the DMC newsgroup: http://forum.dlang.org/group/c++ ? If it is, there's hardly a single post per month.. You overlook that it's a very old compiler - 30 years. In its day it

  1   2   >