Run child process with null stdin/stdout

2014-06-18 Thread David Nadlinger via Digitalmars-d-learn
Hi all, is there a platform independent way to do the equivalent of some_program /dev/null /dev/null using std.process? I neither want to capture/print the standard output of the child process nor have anything available on its input. Quite probably, I'm just missing something obvious…

Re: Run child process with null stdin/stdout

2014-06-18 Thread David Nadlinger via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 20:00:43 UTC, Justin Whear wrote: For POSIX, seems like you could pass `File(/dev/null, r)` for stdin and `File(/dev/null, w)`. On Windows I believe you can use `File (nul)` for the same effect. Implementing this myself is of course always an option, yes, but

Re: D Lang Web Site (and Wiki): How many accounts must one have?

2014-06-16 Thread David Nadlinger via Digitalmars-d
On Monday, 16 June 2014 at 12:03:49 UTC, Tom Browder via Digitalmars-d wrote: Between bugs, code.lang.org, etc., I must have multiple log-in accounts and i've run out of e-mail addresses. Can't there be a single account for dlang.org? The systems run on different machines and are managed by

Re: Dynamic array length ABI unit

2014-06-16 Thread David Nadlinger via Digitalmars-d
On Monday, 16 June 2014 at 11:44:53 UTC, Luís Marques wrote: Regarding the D ABI, http://dlang.org/abi.html , I've noticed that the description for dynamic arrays seems ambiguous: offset property contents 0.length array dimension size_t .ptr pointer to array

Re: D Lang Web Site (and Wiki): How many accounts must one have?

2014-06-16 Thread David Nadlinger via Digitalmars-d
On Monday, 16 June 2014 at 12:50:50 UTC, Tom Browder via Digitalmars-d wrote: All three use an e-mail or user name, but none can be the same apparently. This is not the case. Maybe you just had accounts at the other sites already? Of course, you could also be hitting some strange bug. In

Re: Dynamic array length ABI unit

2014-06-16 Thread David Nadlinger via Digitalmars-d
On Monday, 16 June 2014 at 13:11:24 UTC, Luís Marques wrote: Ah, OK. I was mislead by the following: 1: int[] a1 = [42]; 2: ubyte[] a2 = cast(ubyte[]) a1; 3: writeln(a2); Ah, that clears up the confusion. Array casts are smart and automatically divide down the length

Re: Tail pad optimization, cache friendlyness and C++ interrop

2014-06-15 Thread David Nadlinger via Digitalmars-d
On Wednesday, 11 June 2014 at 16:50:30 UTC, Walter Bright wrote: On 6/11/2014 4:34 AM, Timon Gehr wrote: Not memory safe implies (is supposed to imply) not @safe but not @safe does not imply not memory safe. @safe in D == memory safe. What Timon is saying is that not all memory safe code

Re: D Logos

2014-06-15 Thread David Nadlinger via Digitalmars-d
On Friday, 13 June 2014 at 03:33:41 UTC, Khaled wrote: If you like one of these designs and require some modifications then send me your feedbacks so I can update it accordingly. I like the design in principle, but it doesn't seem to spell D to my eyes at all, like others have already

Rosettacode example collection

2014-06-15 Thread David Nadlinger via Digitalmars-d
Hi all, Somebody (I think bearophile) mentioned a while back that they had a folder with all the D solutions from Rosettacode. I'm looking for some small stand-alone compiler benchmarks, so I'd very much appreciate if whoever it was could contact me via mail. Thanks, David

Re: Out of sight out of mind

2014-06-15 Thread David Nadlinger via Digitalmars-d
On Sunday, 15 June 2014 at 20:14:09 UTC, Brad Roberts via Digitalmars-d wrote: While I agree that some of these points are true, what's not true is that the use of bugzilla and it's separateness from github is the cause. Bugzilla has a similar set of features for categorization and future

Re: Out of sight out of mind

2014-06-15 Thread David Nadlinger via Digitalmars-d
On Sunday, 15 June 2014 at 20:51:59 UTC, Andrew Edwards wrote: My proposal for using one homogeneous system is geared on the idea that people doesn't care to admit that the problem exists or take initiative to fix it if they never have to look at it. How do I have to look at the Issues tab on

Re: DMD 2.066 Alpha

2014-06-14 Thread David Nadlinger via Digitalmars-d-announce
On Thursday, 12 June 2014 at 18:25:36 UTC, Andrei Alexandrescu wrote: On 6/12/14, 6:34 AM, Dicebot wrote: It was decided and 100% certain - virtual is not going in. Need to remove it from DMD before this release is out. Yes please. -- Andrei Since we didn't seem to have a pull request for

Re: dmd front end now switched to Boost license

2014-06-14 Thread David Nadlinger via Digitalmars-d-announce
On Saturday, 14 June 2014 at 18:43:59 UTC, Walter Bright wrote: And there's another advantage I neglected to mention - it allows DMDFE code to be moved into Phobos without issues. I don't think Nick's argument is particularly compelling, but the DDMD - Phobos connection definitely makes the

Re: Strange issue on OSX

2014-06-14 Thread David Nadlinger via Digitalmars-d
On Saturday, 14 June 2014 at 11:16:57 UTC, Marc Schütz wrote: On Saturday, 14 June 2014 at 10:38:08 UTC, Jacob Carlborg wrote: Technically you can run 64bit applications on 32bit OS X if you have a 64bit CPU. Really? The other way round, yes, but this would really surprise me... Yes.

Re: Null pointer dereferencing in D

2014-06-14 Thread David Nadlinger via Digitalmars-d
On Saturday, 14 June 2014 at 16:45:19 UTC, Maxim Fomin wrote: The case which you described is a not a type safety problem. If a struct type has a non-trivial invariant(), .init allows an object to exist that violates it without an Error being thrown. Arguing that this is not part of the

Re: DMD Compiler Version Dependent Conditional Compilation

2014-06-09 Thread David Nadlinger via Digitalmars-d-learn
On Monday, 9 June 2014 at 17:36:10 UTC, Nordlöw wrote: Can I use the version keyword or static if to perform conditional compilation that depends on the version of DMD? The __VERSION__ magic token should do the job. David

[OT] Talks from NDC Oslo 2014 available on Vimeo

2014-06-07 Thread David Nadlinger via Digitalmars-d
Hi all, I just noticed that all the sessions from NDC Oslo 2014 are available online in video form at http://vimeo.com/channels/ndc2014. Andrei's talks (including the one on D) are also among the videos, if you haven't watched them yet. David

Re: (git HEAD) std.datetime spewing deprecation messages

2014-06-04 Thread David Nadlinger via Digitalmars-d
On Tuesday, 3 June 2014 at 17:35:42 UTC, Russel Winder via Digitalmars-d wrote: This all sounds like implementation detail rather than API usage. How can an API problem be an implementation detail? I'm not quite getting your point here. David

Re: Swift is based LLVM,what will the D's LDC do?

2014-06-04 Thread David Nadlinger via Digitalmars-d
On Wednesday, 4 June 2014 at 18:06:08 UTC, Mattcoder wrote: I think it would be a nice for learning experience and contributing more with community. It's always great to see new people interested in helping out with compiler development. Just follow your natural curiosity and don't let the

Re: std.benchmark

2014-05-30 Thread David Nadlinger via Digitalmars-d
On Friday, 30 May 2014 at 05:10:31 UTC, Andrei Alexandrescu wrote: On 5/28/14, 10:28 AM, Dicebot wrote: I'd love to see Andrei comment about it to either update its status or remove from review queue. I will work on it but std.allocator takes precedence. If anyone is in a hurry, please take

Re: std.experimental – DConf?

2014-05-30 Thread David Nadlinger via Digitalmars-d
On Friday, 30 May 2014 at 05:20:57 UTC, Andrei Alexandrescu wrote: Also please don't analyze this to death. It's meant to reduce friction, not increase this. I'm not sure whether your comment was just targeted at the naming discussions, but in general, I find it very valid to discuss the

core.atomic and composite types

2014-05-30 Thread David Nadlinger via Digitalmars-d
Currently, core.atmoic contains severe bugs and is virtually untested for composite types. For example: https://issues.dlang.org/show_bug.cgi?id=12823. The question is: What kind of types we actually want to support? Or, to phrase it differently, is there a reason not to support arbitrary

Re: Performance

2014-05-30 Thread David Nadlinger via Digitalmars-d
On Friday, 30 May 2014 at 13:35:59 UTC, Thomas wrote: gdc ./source/perf/testperf.d -frelease -o testperf This effectively compiles the program without optimizations. Try -O3 or -Ofast. David

std.experimental – DConf?

2014-05-29 Thread David Nadlinger via Digitalmars-d
Hi all, There seems to have been some discussion regarding std.experimental at DConf, as several proposals to add modules to it have popped up over the last few days. Maybe Andrei's keynote had something on it (I unfortunately missed it)? In any case, could somebody please outline the

Re: 64-bit DMD for windows?

2014-05-20 Thread David Nadlinger via Digitalmars-d
On Monday, 19 May 2014 at 17:59:43 UTC, steven kladitis wrote: I see that this thread is over 3 years old. I am totally enjoying D. I love assembler programming. I am just dissapointed that there is simple way to compile 64 bit code as of 2014 in windows. I am still unable to compile 64 bit

Re: Switch to list all druntime calls?

2014-05-20 Thread David Nadlinger via Digitalmars-d
On Tuesday, 20 May 2014 at 10:39:32 UTC, bearophile wrote: Instead (or in addition) of this dmd compiler switch: -vgc list all hidden gc allocations Isn't it more useful a compiler switch like -noruntime (similar to the switch of the ldc2 compiler) meant to list the lines of code

Re: 64-bit DMD for windows?

2014-05-20 Thread David Nadlinger via Digitalmars-d
On Tuesday, 20 May 2014 at 18:47:46 UTC, Temtaime wrote: Please don't ask useful-less questions. One can tell all the advantages of 64 bits or you can use the Wikipedia. You might want to read my response again. I specifically asked How does the current 64 bit version of DMD fall short of

Re: 64-bit DMD for windows?

2014-05-20 Thread David Nadlinger via Digitalmars-d
On Tuesday, 20 May 2014 at 19:15:59 UTC, Temtaime wrote: Yes dmd supports x64 on windows but it doesn't work without external tools. DMD on Linux doesn't work without external tools (system GCC/ld) either. Microsoft provides the required tools for free and they are not difficult to

Re: LDC 0.13.0 beta 1 released!

2014-05-18 Thread David Nadlinger via Digitalmars-d-announce
On Sunday, 18 May 2014 at 11:58:20 UTC, bioinfornatics wrote: Woa uOuh shared lib support added :-) I love you Unfortunately building Phobos as a shared library is not quite supported yet. I added the technical underpinnings for it, but we still need somebody to go through and acutely

Re: Optional monitors suggestion

2014-05-18 Thread David Nadlinger via Digitalmars-d
On Sunday, 18 May 2014 at 10:33:53 UTC, Andrei Alexandrescu wrote: Maybe I misunderstood - I thought the change preserves semantics. -- Andrei There are two layers to the changes discussed in this thread. The first is to remove __monitor from Object. This is something I think we all agree

Re: Memory allocation purity

2014-05-15 Thread David Nadlinger via Digitalmars-d
On Thursday, 15 May 2014 at 06:50:06 UTC, Ola Fosheim Grøstad wrote: On Thursday, 15 May 2014 at 06:29:06 UTC, bearophile wrote: A little example of D purity (this compiles): bool randomBit() pure nothrow @safe { return (new int[1].ptr) (new int[1].ptr); } Yes, and then you may as well

Re: Memory allocation purity

2014-05-15 Thread David Nadlinger via Digitalmars-d
On Thursday, 15 May 2014 at 13:40:16 UTC, Manu via Digitalmars-d wrote: Why should returning a mutable pointer imply weak purity? The argument here is that a valid mutable pointer returned from a pure function could always point to a new allocation, as new is allowed in pure code. More

Re: Memory allocation purity

2014-05-15 Thread David Nadlinger via Digitalmars-d
On Thursday, 15 May 2014 at 13:42:58 UTC, Steven Schveighoffer wrote: On Thu, 15 May 2014 09:24:54 -0400, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com wrote: That's the wrong attitude to take when it comes to the compiler and runtime. There are always ways around the guarantees.

Re: Memory allocation purity

2014-05-15 Thread David Nadlinger via Digitalmars-d
On Thursday, 15 May 2014 at 15:09:32 UTC, Steven Schveighoffer wrote: But in this case, you have ignored the rules, […] Which rules exactly? My point is mainly that this area of the language is underspecified. This means format(%x, ptr) isn't allowed to be pure? The short answer would

[OT] Rust discussion about uniqueness/mutability

2014-05-14 Thread David Nadlinger via Digitalmars-d
Niko Matsakis, Mozilla employee and member of the Rust core team, published a blog post on the terminology regarding mutability and uniqueness in Rust yesterday: http://smallcultfollowing.com/babysteps/blog/2014/05/13/focusing-on-ownership/ It's not directly related to the discussion we are

Re: Array!T and find are slow

2014-05-14 Thread David Nadlinger via Digitalmars-d-learn
On Wednesday, 14 May 2014 at 14:24:28 UTC, Damian Day wrote: I've written some search functions, which are many times faster, is it worth making a pull request? Generally, we strive to make the algorithms in Phobos as fast as possible even in the general case. I didn't look at the issue at

Re: Array!T and find are slow

2014-05-14 Thread David Nadlinger via Digitalmars-d-learn
On Wednesday, 14 May 2014 at 15:42:13 UTC, Damian Day wrote: On Wednesday, 14 May 2014 at 14:54:57 UTC, David Nadlinger wrote: Could you post a short benchmark snippet explicitly showing the problem? Benchmark found here: http://dpaste.dzfl.pl/0058fc8341830 Unfortunately, I don't have the

Re: Array!T and find are slow

2014-05-14 Thread David Nadlinger via Digitalmars-d-learn
On Wednesday, 14 May 2014 at 17:36:35 UTC, monarch_dodra wrote: Adding a special case in Array.Range allows bypassing the repeated indexing costs, but at the very least, should be implemented in terms of find itself, eg: Shouldn't the extra indirection just vanish into thin air once opIndex

Re: From slices to perfect imitators: opByValue

2014-05-08 Thread David Nadlinger via Digitalmars-d
On Thursday, 8 May 2014 at 16:30:13 UTC, Sönke Ludwig wrote: For what practical reason would that be the case? I know that the spec states undefined behavior, but AFAICS, there is neither an existing, nor a theoretical reason, why this should fail: Compiler optimizations based on

Re: isUniformRNG

2014-05-07 Thread David Nadlinger via Digitalmars-d
On Wednesday, 7 May 2014 at 20:11:13 UTC, Nick Sabalausky wrote: HashDRBGStream!() randStream; //aka: // HashDRBGStream!(SHA512, D Crypto RNG) randStream; The stream version isn't a range and only supports filling a provided ubyte[] buffer. So no element type. Shouldn't that take an ubyte

Re: isUniformRNG

2014-05-07 Thread David Nadlinger via Digitalmars-d
On Wednesday, 7 May 2014 at 21:01:20 UTC, David Nadlinger wrote: Shouldn't that take an ubyte output range instead? Erm, scrap that, wasn't thinking. David

Re: FYI - mo' work on std.allocator

2014-04-27 Thread David Nadlinger via Digitalmars-d
On Sunday, 27 April 2014 at 11:13:42 UTC, Marc Schütz wrote: Also, there is an `expand()` method, but no `shrink()`. Is that an oversight, or intentional? If I remember correctly, this was discussed in the initial review of Andrei's proposal (just search the NG for std.allocator). David

Re: DIP61: Add namespaces to D

2014-04-26 Thread David Nadlinger via Digitalmars-d
On Saturday, 26 April 2014 at 18:11:18 UTC, Walter Bright wrote: On 4/26/2014 4:57 AM, Dicebot wrote: Necessity to define namespaces for interfacing with C++ must not result in usage of namespaces of pure D code. Why? I don't see much of any use for namespaces in pure D code, […] This is

Re: DIP61: Add namespaces to D

2014-04-26 Thread David Nadlinger via Digitalmars-d
On Saturday, 26 April 2014 at 21:57:55 UTC, Timon Gehr wrote: Which is all the DIP adds. I do not really understand the objections. It adds a new language feature, which is not just used only in a rather specific situation, but also very likely to be confused with the eponymous feature from

Re: if Condition expression can't have function?

2014-04-25 Thread David Nadlinger via Digitalmars-d
On Friday, 25 April 2014 at 07:14:48 UTC, FrankLike wrote: Hi,everyone, Here has a error after run: main.exe 11 or main.exe 10 : […] Why? size_t (the return type of your find()) is always non-negative, hence the if condition is never false. In the future, you might want to consider

Re: DIP60: @nogc attribute

2014-04-25 Thread David Nadlinger via Digitalmars-d
On Friday, 25 April 2014 at 12:07:00 UTC, Steven Schveighoffer wrote: One interesting thing about this is that the compiler implementation may make some @nogc code valid on some compilers, and invalid on others, even though the resulting execution is the same. I don't think this is a

<    2   3   4   5   6   7