Re: D parsing

2013-11-01 Thread Andrei Alexandrescu
On 11/1/13 9:06 PM, Manfred Nowak wrote: Andrei Alexandrescu wrote: Bugs stopping Pegged from going forward should receive high priority. One prerequisite for every PEG-Parser is, that the language has to be designed to be without any ambiguity. This is not the case for D, because of its evo

Re: D parsing

2013-11-01 Thread Manfred Nowak
Andrei Alexandrescu wrote: > Bugs stopping Pegged from going forward should receive high priority. One prerequisite for every PEG-Parser is, that the language has to be designed to be without any ambiguity. This is not the case for D, because of its evolution based on recursive descent parsing

Re: Everyone who writes safety critical software should read this

2013-11-01 Thread Walter Bright
On 11/1/2013 6:52 AM, Wyatt wrote: "We could, for instance, begin with cleaning up our language by no longer calling a bug a bug but by calling it an error. It is much more honest because it squarely puts the blame where it belongs, viz. with the programmer who made the error. Although it is te

Re: Everyone who writes safety critical software should read this

2013-11-01 Thread Walter Bright
On 11/1/2013 8:03 AM, bearophile wrote: Everyone who writes safety critical software should really avoid languages unable to detect integral overflows (at compile-time or run-time) in all normal numerical operations, and languages that have undefined operations in their basic semantics. So Ada l

Re: Everyone who writes safety critical software should read this

2013-11-01 Thread bearophile
eles: Yeah, after the scope() statement, this is the thing that I'd want the most in my C, The latest versions of Clang are able to catch some integral overflows at run-time. It is of course only a small part of the whole amount of things needed to produce correct code, but for high integri

Re: std.allocator ready for some abuse

2013-11-01 Thread Andrei Alexandrescu
On 11/1/13 2:12 PM, Dicebot wrote: That makes me think probably Phobos should have a package.json so people can install updates via code.dlang.org. How would you imagine that? Not-yet-in-Phobos packages are expected to be submitted as standalone ones, not as whole Phobos repo. I meant people

Re: D parsing

2013-11-01 Thread Andrei Alexandrescu
On 11/1/13 1:59 PM, Philippe Sigaud wrote: The examples directory shows different grammars, from JSON to XML to C to D. I used it with the D grammar, but the one on the website is woefully inadequate (some mistakes, out of date compared to the compiler and written in a somewhat convoluted style

Re: std.allocator ready for some abuse

2013-11-01 Thread Dicebot
That makes me think probably Phobos should have a package.json so people can install updates via code.dlang.org. How would you imagine that? Not-yet-in-Phobos packages are expected to be submitted as standalone ones, not as whole Phobos repo.

Re: std.allocator ready for some abuse

2013-11-01 Thread Andrei Alexandrescu
On 11/1/13 1:36 PM, Martin Nowak wrote: I have another request despite putting this in it's own repo. I assume s/despite/in addition to/ :o). Often one want an exponentially (power of 2) growing step size for Bucketizer. Currently only equally spaced buckets are possible which isn't very prac

Re: D parsing

2013-11-01 Thread Philippe Sigaud
The examples directory shows different grammars, from JSON to XML to C to D. I used it with the D grammar, but the one on the website is woefully inadequate (some mistakes, out of date compared to the compiler and written in a somewhat convoluted style full of left-recursion). The shortcomings are

Re: std.allocator ready for some abuse

2013-11-01 Thread Andrei Alexandrescu
On 10/30/13 1:02 PM, Martin Nowak wrote: This looks really promising. There are a lot of building blocks and the way different capabilities are modelled by optional methods nicely solves the biggest difficulty with allocators. I think it's important to put this in it's own github repo and add a d

Re: Everyone who writes safety critical software should read this

2013-11-01 Thread eles
On Friday, 1 November 2013 at 15:03:47 UTC, bearophile wrote: Walter Bright: avoid languages unable to detect integral overflows (at compile-time or run-time) in all normal numerical operations, Yeah, after the scope() statement, this is the thing that I'd want the most in my C, at least du

Re: Everyone who writes safety critical software should read this

2013-11-01 Thread eles
On Friday, 1 November 2013 at 13:52:01 UTC, Wyatt wrote: On Thursday, 31 October 2013 at 21:36:11 UTC, eles wrote: much more honest because it squarely puts the blame where it belongs, viz. with the programmer who made the error. The That's in an ideal world. When different people work on th

Re: std.allocator ready for some abuse

2013-11-01 Thread Martin Nowak
I have another request despite putting this in it's own repo. Often one want an exponentially (power of 2) growing step size for Bucketizer. Currently only equally spaced buckets are possible which isn't very practical to scale from 16b to 2Mb. http://erdani.com/d/phobos-prerelease/std_allocat

Re: std.allocator ready for some abuse

2013-11-01 Thread Martin Nowak
On 11/01/2013 03:34 AM, Andrei Alexandrescu wrote: Added SharedFreelist, a lock-free freelist. http://erdani.com/d/phobos-prerelease/std_allocator.html#.SharedFreelist Andrei Nice, that reminds me that I still want to polish my implementation of a lock free doubly-linked list in D. It woul

Re: D parsing

2013-11-01 Thread Martin Nowak
On 10/31/2013 07:10 AM, Philippe Sigaud wrote: Now, if you want parsing specifically, what do you want to get? A parse tree? In that case, you can for example use one of my projects, Pegged, which generates CT-compatible parsers (that is, functions that can use CTFE to parse a string at CT). Pars

Re: Expanding the horizons of D purity

2013-11-01 Thread deadalnix
On Friday, 1 November 2013 at 17:21:07 UTC, H. S. Teoh wrote: The second one is the inout problem. Qualifier in output may reflect the one in inputs. inout solve this for some type qualifiers, but sometime is ambiguous and does nothing for the problem at large. I'm not sure what inout has to

Pure tail call optimization

2013-11-01 Thread Simen Kjaeraas
Today, while playingly adding const annotations to std.bigint, I noticed that I ended up with a few casts - or more specifically, assumeUniques. Now, the interesting thing was the pattern they formed. Almost invariably, it's like this: BigUint foo() pure { uint[] result;

D Programmer Jobs at Sociomantic Labs

2013-11-01 Thread Marenz
Hey D Programmers, so, we at Sociomantic Labs are once again (or still) looking for D-Developers in Berlin. And lots of them. Currently still D1, but the process to change to D2 is initiated. You can read more about it here: https://www.sociomantic.com/jobs/d-software-developer/#.UnPl4Xh385Y

Re: std.allocator ready for some abuse

2013-11-01 Thread safety0ff
On Friday, 1 November 2013 at 15:15:10 UTC, Andrei Alexandrescu wrote: Migrating the flags into the type is a possibility but maybe it's easiest to add flags as runtime parameters. I was using that as an example to argue for its inclusion because it was concise. I'm not sure what the best in

Re: Expanding the horizons of D purity

2013-11-01 Thread H. S. Teoh
On Thu, Oct 31, 2013 at 10:10:03PM +0100, Timon Gehr wrote: > On 10/31/2013 09:05 PM, H. S. Teoh wrote: [...] > >So, in a nutshell, my proposal is: > > > >- Functions that, besides invoking a delegate parameter, are pure, > > should be allowed to be marked as pure. > > > >- Template functions tha

Re: Expanding the horizons of D purity

2013-11-01 Thread H. S. Teoh
On Fri, Nov 01, 2013 at 12:26:43AM +0100, deadalnix wrote: > I think you take it the wrong way. Weak purity have some guarantee > in itself, like you know it won't reach shared data unless you pass > them explicitly, do not touch anything static, etc . . . This still holds. Passing a delegate that

Re: Expanding the horizons of D purity

2013-11-01 Thread H. S. Teoh
On Fri, Nov 01, 2013 at 08:59:29PM +0400, Denis Shelomovskij wrote: > 01.11.2013 0:05, H. S. Teoh пишет: [...] > >So, in a nutshell, my proposal is: > > > >- Functions that, besides invoking a delegate parameter, are pure, > > should be allowed to be marked as pure. > > > >- Template functions tha

Re: Expanding the horizons of D purity

2013-11-01 Thread Denis Shelomovskij
01.11.2013 0:05, H. S. Teoh пишет: [I actually came up with this idea last week, but decided to postpone bringing it up until all the furor about Andrei's new allocator design has settled a little. ;-)] One of the neatest things about purity in D is that traditionally impure operations like muta

Re: Expanding the horizons of D purity

2013-11-01 Thread Kenji Hara
2013/11/1 Timon Gehr > On 11/01/2013 03:21 PM, Kenji Hara wrote: > >> >> The first delegate should not become pure. >> > > Why not? It is weakly pure, like the following: > > void main(){ > struct S{ > int num; > void member(int x)pure{ num = x; } // pure > } > S s; >

Re: Everyone who writes safety critical software should read this

2013-11-01 Thread Chris
On Friday, 1 November 2013 at 13:52:01 UTC, Wyatt wrote: On Thursday, 31 October 2013 at 21:36:11 UTC, eles wrote: Yeah, maybe is a corporation culture to avoid the term "bug", but we always use the term "change request". Maybe it has a better image :) Lately, I've instead been reframing my

Re: std.allocator ready for some abuse

2013-11-01 Thread Andrei Alexandrescu
On 10/31/13 8:37 PM, safety0ff wrote: On Friday, 1 November 2013 at 02:43:00 UTC, Andrei Alexandrescu wrote: On 10/31/13 7:26 PM, safety0ff wrote: I noticed that the GCAllocator provides no way of controlling the memory block attributes (http://dlang.org/phobos/core_memory.html#.GC.BlkAttr ,) a

Re: Everyone who writes safety critical software should read this

2013-11-01 Thread bearophile
Walter Bright: ... Everyone who writes safety critical software should really avoid languages unable to detect integral overflows (at compile-time or run-time) in all normal numerical operations, and languages that have undefined operations in their basic semantics. So Ada language is OK,

Re: Please stop doing this.

2013-11-01 Thread Kagamin
Scintilla has lexer tests which work by marking up the output and comparing with etalon string.

Re: Expanding the horizons of D purity

2013-11-01 Thread Timon Gehr
On 11/01/2013 03:21 PM, Kenji Hara wrote: 2013/11/1 Timon Gehr mailto:timon.g...@gmx.ch>> On 11/01/2013 02:36 PM, Kenji Hara wrote: I think this is a good discovery. Currently a pure function can have lazy parameters and it is treated as a weakly pure function. pure

Re: Expanding the horizons of D purity

2013-11-01 Thread Kenji Hara
2013/11/1 Timon Gehr > On 11/01/2013 02:36 PM, Kenji Hara wrote: > >> I think this is a good discovery. Currently a pure function can have >> lazy parameters and it is treated as a weakly pure function. >> >> pure int foo(lazy int x) { return x; } // OK >> >> We can think the lazy parameter is a

Re: Expanding the horizons of D purity

2013-11-01 Thread Timon Gehr
On 11/01/2013 02:36 PM, Kenji Hara wrote: I think this is a good discovery. Currently a pure function can have lazy parameters and it is treated as a weakly pure function. pure int foo(lazy int x) { return x; } // OK We can think the lazy parameter is a limited case of scope delegate parameter

Re: Expanding the horizons of D purity

2013-11-01 Thread Timon Gehr
On 11/01/2013 01:43 PM, Wyatt wrote: On Friday, 1 November 2013 at 11:45:23 UTC, Timon Gehr wrote: return (y)pure=x=y; Drifting off topic a little, but how does this expression work? I can't recall having seen the (y)pure thing before. -Wyatt It is in a comment. The exact expression wo

Re: Expanding the horizons of D purity

2013-11-01 Thread Kenji Hara
I think this is a good discovery. Currently a pure function can have lazy parameters and it is treated as a weakly pure function. pure int foo(lazy int x) { return x; } // OK We can think the lazy parameter is a limited case of scope delegate parameter. And more, I discovered that the purity ma

Re: ctrl+c and destructors

2013-11-01 Thread Jacob Carlborg
On 2013-11-01 12:56, Wyatt wrote: I would classify forcing someone to use iTunes as "psychological warfare". Unfortunately, that's not covered by the EULA. ;) Then you're good to go :) -- /Jacob Carlborg

Re: Everyone who writes safety critical software should read this

2013-11-01 Thread Chris
On Thursday, 31 October 2013 at 19:45:17 UTC, Walter Bright wrote: On 10/31/2013 7:57 AM, H. S. Teoh wrote: You don't know how thankful I am for having learnt the concept of pumping the brakes, ABS or not. I'm afraid too many driving instructors nowadays just advise slamming the brakes and rely

Re: Expanding the horizons of D purity

2013-11-01 Thread Wyatt
On Friday, 1 November 2013 at 11:45:23 UTC, Timon Gehr wrote: return (y)pure=x=y; Drifting off topic a little, but how does this expression work? I can't recall having seen the (y)pure thing before. -Wyatt

Re: ctrl+c and destructors

2013-11-01 Thread Wyatt
On Thursday, 31 October 2013 at 22:20:23 UTC, Timon Gehr wrote: I'm not sure. Excerpt from the iTunes EULA: "You also agree that you will not use these products for any purposes prohibited by United States law, including, without limitation, the development, design, manufacture or production

Re: Expanding the horizons of D purity

2013-11-01 Thread Timon Gehr
On 11/01/2013 12:45 PM, Timon Gehr wrote: auto a=bar(); // note: a is pure (as in 'weakly pure'.)

Re: Expanding the horizons of D purity

2013-11-01 Thread Timon Gehr
On 11/01/2013 12:26 AM, deadalnix wrote: I think you take it the wrong way. Weak purity have some guarantee in itself, like you know it won't reach shared data I assume you mean mutable shared data. unless you pass them explicitly, do not touch anything static, Unless you pass it in explici

Re: proposal: a new string litteral to embed variables in a string

2013-11-01 Thread Jacob Carlborg
On 2013-10-31 22:47, Timothee Cour wrote: $ is another obvious choice (eg in shell expansion) but # could also be good as it's very much unused in D. Yeah, # is only used for #line, which should be less common than $. -- /Jacob Carlborg

Re: ctrl+c and destructors

2013-11-01 Thread Jacob Carlborg
On 2013-10-31 23:20, Timon Gehr wrote: I'm not sure. Excerpt from the iTunes EULA: "You also agree that you will not use these products for any purposes prohibited by United States law, including, without limitation, the development, design, manufacture or production of nuclear, missiles, or ch