What does the -betterC switch in dmd do?

2015-11-12 Thread TheFlyingFiddle via Digitalmars-d-learn
The description in dmd help says: omit generating some runtime information and helper functions. What runtime information are we talking about here? My understanding is that it's basically an experimental feature but when (if) completed what subset of the language would still be usable?

Re: OSX Foundation framework D binding

2015-11-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-11-12 06:50, Vadim Lopatin wrote: Aren't there any ready set of translated and post-processed files for main OSX foundations in some repository? Could you point at it? I have these 6 years old bindings [1] which uses an old Objective-C bridge. Perhaps it's possible to do some

Re: OSX Foundation framework D binding

2015-11-12 Thread ponce via Digitalmars-d-learn
On Wednesday, 11 November 2015 at 16:06:57 UTC, Jacob Carlborg wrote: On 2015-11-11 10:29, Daniel Kozak via Digitalmars-d-learn wrote: I find only this one: http://code.dlang.org/packages/derelict-cocoa Also, there's no point in complicate the bindings by using function pointers like this.

Re: my first D program (and benchmark against perl)

2015-11-12 Thread Daniel Kozak via Digitalmars-d-learn
On Wednesday, 11 November 2015 at 13:32:00 UTC, perlancar wrote: Here's my first non-hello-world D program, which is a direct translation from the Perl version. I was trying to get a feel about D's performance: ... While I am quite impressed with how easy I was able to write D, I am not so

Re: How to fix "Error symbol '.....' is already defined"

2015-11-12 Thread Kagamin via Digitalmars-d-learn
Looks like a bug in the compiler.

Re: my first D program (and benchmark against perl)

2015-11-12 Thread Daniel Kozak via Digitalmars-d-learn
V Thu, 12 Nov 2015 09:12:32 + Daniel Kozak via Digitalmars-d-learn napsáno: > On Wednesday, 11 November 2015 at 13:32:00 UTC, perlancar wrote: > > Here's my first non-hello-world D program, which is a direct > > translation from the Perl version. I was

Re: What does the -betterC switch in dmd do?

2015-11-12 Thread Justin Whear via Digitalmars-d-learn
On Thu, 12 Nov 2015 19:37:41 +, TheFlyingFiddle wrote: > The description in dmd help says: omit generating some runtime > information and helper functions. > > What runtime information are we talking about here? My > understanding is that it's basically an experimental feature but > when

Re: my first D program (and benchmark against perl)

2015-11-12 Thread Daniel Kozak via Digitalmars-d-learn
V Thu, 12 Nov 2015 11:03:38 + Tobias Pankrath via Digitalmars-d-learn napsáno: > > or with ~ operator: > > > > import std.stdio; > > > > [...] > > Did anyone check that the last loop isn't optimized out? Yes, it is not optimized out > Could also be

Re: my first D program (and benchmark against perl)

2015-11-12 Thread perlancar via Digitalmars-d-learn
On Wednesday, 11 November 2015 at 14:20:51 UTC, Rikki Cattermole wrote: I turned it into mostly using large allocations, instead of small ones. Although I'd recommend using Appender instead of my custom functions for this. Oh and for me, I got it at 2 secs, 513 ms, 397 μs, and 5 hnsecs.

Re: Compiler doesn't complain with multiple definitions

2015-11-12 Thread anonymous via Digitalmars-d-learn
On 12.11.2015 06:27, ric maicle wrote: I was playing with __traits and tried the code below. Shouldn't the compiler emit a warning that I'm defining isPOD multiple times and/or I'm defining something that is built-in like isPOD? // DMD64 D Compiler v2.069 import std.stdio; struct isPOD { bool

Re: my first D program (and benchmark against perl)

2015-11-12 Thread perlancar via Digitalmars-d-learn
On Wednesday, 11 November 2015 at 14:26:32 UTC, Andrea Fontana wrote: Did you try rdmd -O -noboundscheck -release yourscript.d ? I just did. It improves speed from 17.127s to 14.831s. Nice, but nowhere near gdc/ldc level. You should try using appender!string rather than concatenate

Re: my first D program (and benchmark against perl)

2015-11-12 Thread Daniel Kozak via Digitalmars-d-learn
V Thu, 12 Nov 2015 12:13:10 + perlancar via Digitalmars-d-learn napsáno: > On Wednesday, 11 November 2015 at 14:20:51 UTC, Rikki Cattermole > wrote: > > I turned it into mostly using large allocations, instead of > > small ones. > > Although I'd recommend

Re: OSX Foundation framework D binding

2015-11-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-11-12 09:34, ponce wrote: Opinion. I only ever got problems with bindings that aren't dynamic. For example that problem would not happen with dynamic loading. https://github.com/nomad-software/x11/issues/11 I've never encountered that problem. -- /Jacob Carlborg

Re: my first D program (and benchmark against perl)

2015-11-12 Thread Tobias Pankrath via Digitalmars-d-learn
or with ~ operator: import std.stdio; [...] Did anyone check that the last loop isn't optimized out? Could also be improved further if you make the function take an output range and reuse one appender for every call, but that might be to far off the original perl solution.

Re: How to fix "Error symbol '.....' is already defined"

2015-11-12 Thread Vincent R via Digitalmars-d-learn
On Thursday, 12 November 2015 at 08:45:57 UTC, Kagamin wrote: Looks like a bug in the compiler. In this case it means there is a bug inside dmd and gdc (didn't try ldc)...

Re: my first D program (and benchmark against perl)

2015-11-12 Thread Daniel Kozak via Digitalmars-d-learn
On Thursday, 12 November 2015 at 12:25:08 UTC, Daniel Kozak wrote: V Thu, 12 Nov 2015 12:13:10 + perlancar via Digitalmars-d-learn napsáno: On Wednesday, 11 November 2015 at 14:20:51 UTC, Rikki Cattermole wrote: > I turned it into mostly using large

Re: win32 from master: unicode functions by default?

2015-11-12 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 12 November 2015 at 15:58:53 UTC, Jonathan M Davis wrote: On Thursday, November 12, 2015 05:08:24 Mike Parker via version=Unicode on the compiler command line. It seems pretty wrong for the A versions to be the default though... Still, even in C++ code, I've generally taken

Re: my first D program (and benchmark against perl)

2015-11-12 Thread Daniel Kozak via Digitalmars-d-learn
On Thursday, 12 November 2015 at 12:49:55 UTC, Daniel Kozak wrote: On Thursday, 12 November 2015 at 12:25:08 UTC, Daniel Kozak wrote: ... auto res = appender(uninitializedArray!(char[])(total)); res.clear(); ... this is faster for DMD and ldc: auto res = appender!(string)();

Re: Compiler doesn't complain with multiple definitions

2015-11-12 Thread ric maicle via Digitalmars-d-learn
On Thursday, 12 November, 2015 07:50 PM, anonymous wrote: __traits has special syntax. The first "argument" must be from a list of special keywords that only have special meaning in that place. You can't put the name of a struct there, and you can't put the special keyword anywhere else. So

Re: win32 from master: unicode functions by default?

2015-11-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, November 12, 2015 05:08:24 Mike Parker via Digitalmars-d-learn wrote: > On Thursday, 12 November 2015 at 04:58:42 UTC, Andre wrote: > > Hi, > > > > by using the win32 library from master, the functions aliases > > to the ansi windows functions (...A) instead of the unicode > >

Re: Compiler doesn't complain with multiple definitions

2015-11-12 Thread John Colvin via Digitalmars-d-learn
On Thursday, 12 November 2015 at 15:06:26 UTC, ric maicle wrote: On Thursday, 12 November, 2015 07:50 PM, anonymous wrote: __traits has special syntax. The first "argument" must be from a list of special keywords that only have special meaning in that place. You can't put the name of a struct

Re: my first D program (and benchmark against perl)

2015-11-12 Thread perlancar via Digitalmars-d-learn
On Thursday, 12 November 2015 at 12:49:55 UTC, Daniel Kozak wrote: dmd -O -release -inline -boundscheck=off asciitable.d real0m1.463s user0m1.453s sys 0m0.003s ldc2 -singleobj -release -O3 -boundscheck=off asciitable.d real0m0.945s user0m0.940s sys 0m0.000s gdc -O3