Re: core.simd woes

2012-10-02 Thread jerro
SIMD in LDC is currently broken What problems did you have with it? It seems to work fine for me.

Re: openMP

2012-10-02 Thread Farmer
And is there also a pragma omp critical analogon? On Tuesday, 2 October 2012 at 20:16:36 UTC, Peter Alexander wrote: On Tuesday, 2 October 2012 at 19:15:19 UTC, Farmer wrote: Hi, I am tempted to start D programming but for me it is crucrial to be able to parallelize for-loops as can be done

Re: std.intrinsic?

2012-10-02 Thread Iain Buclaw
On Tuesday, 2 October 2012 at 21:06:04 UTC, Manu wrote: I just installed dmd 2.60 in linux, and it seems std.intrinsic isn't there... is this my fault somehow, or has it been removed? I need the bsr() intrinsic which (used to?) live there. import core.bitop;

Re: std.intrinsic?

2012-10-02 Thread Manu
On 3 October 2012 00:17, Iain Buclaw ibuc...@ubuntu.com wrote: On Tuesday, 2 October 2012 at 21:06:04 UTC, Manu wrote: I just installed dmd 2.60 in linux, and it seems std.intrinsic isn't there... is this my fault somehow, or has it been removed? I need the bsr() intrinsic which (used to?)

Re: Idea: Introduce zero-terminated string specifier

2012-10-02 Thread Andrej Mitrovic
On 10/2/12, Walter Bright newshou...@digitalmars.com wrote: On 9/30/2012 11:31 AM, deadalnix wrote: If you know that a string is 0 terminated, you can easily create a slice from it as follow : char* myZeroTerminatedString; char[] myZeroTerminatedString[0 .. strlen(myZeroTerminatedString)];

Re: openMP

2012-10-02 Thread Peter Alexander
On Tuesday, 2 October 2012 at 21:13:33 UTC, Farmer wrote: And is there also a pragma omp critical analogon? For critical sections you could use a low-level mutex. I don't do much parallel stuff in D, so I don't know if this is the preferred way, but it's an option.

Re: qtD

2012-10-02 Thread Eldar Insafutdinov
On Monday, 1 October 2012 at 17:31:11 UTC, Habibutsu wrote: Anybody knows, project qtd (http://www.dsource.org/projects/qtd/) is alive or died? Last changes was one year ago. Tracking system contains critical bugs and nobody fixes. There may be other working bindings for Qt? Hey, yes I

Re: IndexType for ranges

2012-10-02 Thread Nick Sabalausky
On Tue, 02 Oct 2012 19:23:48 +0200 Jonathan M Davis jmdavisp...@gmx.com wrote: On Tuesday, October 02, 2012 19:10:53 monarch_dodra wrote: Ideally, only size_t would be allowed. Reality makes it so that we need ulong in some cases (e.g. iota). Given that fact, you'd ideally restrict it to

Is it possible to tag pull requests?

2012-10-02 Thread Andrej Mitrovic
Some pull requests are rather trivial to approve and merge (e.g. small doc fixes, typo fixes), and it would be nice if a pull requester could tag a pull as trivial when the pull is made. Otherwise I guess we could start using a convention and add [trivial] before the title? I think it might help

Re: Idea: Introduce zero-terminated string specifier

2012-10-02 Thread Jakob Ovrum
On Tuesday, 2 October 2012 at 21:30:35 UTC, Andrej Mitrovic wrote: On 10/2/12, Walter Bright newshou...@digitalmars.com wrote: On 9/30/2012 11:31 AM, deadalnix wrote: If you know that a string is 0 terminated, you can easily create a slice from it as follow : char* myZeroTerminatedString;

Re: RFC: DConf 2013

2012-10-02 Thread MattCoder
On Monday, 1 October 2012 at 16:25:12 UTC, Andrei Alexandrescu wrote: The project is not live, it will be within a few days. In the spirit of having the community actively participate, I'm making this as transparent as it gets. Please comment:

Re: core.simd woes

2012-10-02 Thread F i L
On Tuesday, 2 October 2012 at 21:03:36 UTC, jerro wrote: SIMD in LDC is currently broken What problems did you have with it? It seems to work fine for me. Can you post an example of doing a simple arithmetic with two 'float4's? My simple tests either fail with LLVM errors or don't produce

Re: core.simd woes

2012-10-02 Thread F i L
Also, I'm using the LDC off the official Arch community repo.

How do I run DMD unittests on win32?

2012-10-02 Thread Andrej Mitrovic
I'm starting to contribute to DMD by fixing some bugs, but I need to run the test-suite. Anyone know how this is done on win32? There's a makefile in the test dir but what I don't know is if I need to set up my directory structure in any special way? Is it simpler to just make the pull request

Re: Idea: Introduce zero-terminated string specifier

2012-10-02 Thread Andrej Mitrovic
On 10/3/12, Jakob Ovrum jakobov...@gmail.com wrote: writefln cannot be @safe if it has to support an unsafe format specifier. It's hidden because it affects every call to writefln, even if it doesn't use the unsafe format specifier. Ah damn I completely forgot about @safe. I tend to avoid

Re: Idea: Introduce zero-terminated string specifier

2012-10-02 Thread H. S. Teoh
On Wed, Oct 03, 2012 at 03:07:14AM +0200, Andrej Mitrovic wrote: On 10/3/12, Jakob Ovrum jakobov...@gmail.com wrote: writefln cannot be @safe if it has to support an unsafe format specifier. It's hidden because it affects every call to writefln, even if it doesn't use the unsafe format

Re: core.simd woes

2012-10-02 Thread jerro
import core.simd, std.stdio; void main() { float4 a = 1, b = 2; writeln((a + b).array); // WORKS: [3, 3, 3, 3] float4 c = [1, 2, 3, 4]; // ERROR: Stored value type does // not match pointer operand type! // [..a bunch of LLVM error

Re: How do I run DMD unittests on win32?

2012-10-02 Thread Andrej Mitrovic
On 10/3/12, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: I'm starting to contribute to DMD by fixing some bugs, but I need to run the test-suite. Anyone know how this is done on win32? There's a makefile in the test dir but what I don't know is if I need to set up my directory structure

Re: How do I run DMD unittests on win32?

2012-10-02 Thread Andrej Mitrovic
On 10/3/12, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Hmm I was trying to find the autotester source script to figure this out on my own, but I can't find the source anywhere. :) I'm pretty sure I saw it on github somewhere though? Ok found it: https://github.com/braddr/d-tester

Re: How do I run DMD unittests on win32?

2012-10-02 Thread Andrej Mitrovic
On 10/3/12, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Ok found it: https://github.com/braddr/d-tester Yikes, this is cygwin. Well if nothing else I'll make a D driver script, I'm not in the mood to deal with cygwin or virtual machines.

Re: RFC: DConf 2013

2012-10-02 Thread Andrei Alexandrescu
On 10/2/12 8:23 PM, MattCoder wrote: On Monday, 1 October 2012 at 16:25:12 UTC, Andrei Alexandrescu wrote: The project is not live, it will be within a few days. In the spirit of having the community actively participate, I'm making this as transparent as it gets. Please comment:

Re: Idea: Introduce zero-terminated string specifier

2012-10-02 Thread Jonathan M Davis
On Tuesday, October 02, 2012 18:21:30 H. S. Teoh wrote: On Wed, Oct 03, 2012 at 03:07:14AM +0200, Andrej Mitrovic wrote: On 10/3/12, Jakob Ovrum jakobov...@gmail.com wrote: writefln cannot be @safe if it has to support an unsafe format specifier. It's hidden because it affects every call

Re: Is it possible to tag pull requests?

2012-10-02 Thread Jesse Phillips
On Tuesday, 2 October 2012 at 23:21:13 UTC, Andrej Mitrovic wrote: Some pull requests are rather trivial to approve and merge (e.g. small doc fixes, typo fixes), and it would be nice if a pull requester could tag a pull as trivial when the pull is made. Otherwise I guess we could start using

Re: core.simd woes

2012-10-02 Thread F i L
jerro wrote: This code gives me internal compiler errors with GDC and DMD too (with float4 c = [1, 2, 3, 4] commented out). I'm using DMD 2.060 and a recent versions of GDC and LDC on 64 bit Linux. Yes the SIMD situation isn't entirely usable right now with DMD and LDC. Only simple vector

Re: A study on immutability usage

2012-10-02 Thread Jeff Nowakowski
On 10/01/2012 09:39 PM, Bernard Helyer wrote: Our results from 14 Java applications Only 14? So it's a useless statistic. No, that isn't true. How many language decisions in D are based on an analysis of even 5 programs, let alone 14? What if you were testing to see how fair a coin was,

Re: Idea: Introduce zero-terminated string specifier

2012-10-02 Thread H. S. Teoh
On Tue, Oct 02, 2012 at 07:50:09PM -0700, Jonathan M Davis wrote: On Tuesday, October 02, 2012 18:21:30 H. S. Teoh wrote: On Wed, Oct 03, 2012 at 03:07:14AM +0200, Andrej Mitrovic wrote: On 10/3/12, Jakob Ovrum jakobov...@gmail.com wrote: writefln cannot be @safe if it has to support an

Re: Idea: Introduce zero-terminated string specifier

2012-10-02 Thread Jakob Ovrum
On Wednesday, 3 October 2012 at 05:04:01 UTC, H. S. Teoh wrote: Yes that's what I mean. If the format string is known at compile-time and known to involve only @safe code, then this would work. Something like this might work if CTFE is used to parse the format string piecemeal (i.e., translate

Tips for debugging EXC_BAD_ACCESS

2012-10-02 Thread Jacob Carlborg
I'm trying to debug the Mac OS X port of DWT. Almost as soon as a DWT application starts to process events I receive a segmentation fault. The error happens in the objc_msgSend C function when calling an Objective-C method. GDB backtrace: http://pastebin.com/0fmUmPQ1 The source code of DWT

Re: Accessing CoInit [is Troubleshooting Linker error]

2012-10-02 Thread Richard Webb
I haven't tried to use DMD 2.060 yet, will see if i've got time later.

Re: Accessing CoInit [is Troubleshooting Linker error]

2012-10-02 Thread Andrej Mitrovic
On 10/2/12, Jesse Phillips jessekphillip...@gmail.com wrote: I've made the changes needed to get past the linker error I'm sorry, I was completely wrong about STDAPI being extern(C). I saw EXTERN_C and immediately thought this was the calling convention, it's not: #define STDAPI

Re: Troubleshooting Linker error (Symbol Undefined)

2012-10-02 Thread Andrej Mitrovic
On 10/2/12, Jesse Phillips jessekphillip...@gmail.com wrote: Thank you, making these changes did do the trick As mentioned in the other thread I was wrong, it's extern(Windows), but implib produced an import lib which didn't quite work. coffimplib does the trick though.

Re: Accessing CoInit [is Troubleshooting Linker error]

2012-10-02 Thread Jesse Phillips
On Tuesday, 2 October 2012 at 09:48:00 UTC, Andrej Mitrovic wrote: I'm sorry, I was completely wrong about STDAPI being extern(C). I saw EXTERN_C and immediately thought this was the calling convention, it's not: #define STDAPI EXTERN_C HRESULT STDAPICALLTYPE #define

Functional vs simple code

2012-10-02 Thread ixid
Without optimization the range and algorithm method takes about 10 times as long as the simple code below it, with no array bounds checking and optimization it takes six times as long. Why is the difference so huge? I'd expect a moderate overhead but that's a big difference. module main;

Re: Functional vs simple code

2012-10-02 Thread ixid
On Tuesday, 2 October 2012 at 20:48:31 UTC, ixid wrote: Without optimization the range and algorithm method takes about 10 times as long as the simple code below it, with no array bounds checking and optimization it takes six times as long. Why is the difference so huge? I'd expect a moderate

Re: Functional vs simple code

2012-10-02 Thread Timon Gehr
On 10/02/2012 10:48 PM, ixid wrote: Without optimization the range and algorithm method takes about 10 times as long as the simple code below it, with no array bounds checking and optimization it takes six times as long. Why is the difference so huge? I'd expect a moderate overhead but that's a

Re: Functional vs simple code

2012-10-02 Thread Timon Gehr
On 10/03/2012 12:11 AM, Timon Gehr wrote: ... $ cat ixidbench.d module main; import std.stdio, std.algorithm, std.range, std.datetime; enum MAX = 10_000_000_000UL; void main() { StopWatch sw; sw.start; auto sum1 = MAX.iota.map!(x = x * x).reduce!a + b; sw.stop;

Re: Functional vs simple code

2012-10-02 Thread ixid
On Tuesday, 2 October 2012 at 22:13:10 UTC, Timon Gehr wrote: On 10/03/2012 12:11 AM, Timon Gehr wrote: ... $ cat ixidbench.d module main; import std.stdio, std.algorithm, std.range, std.datetime; enum MAX = 10_000_000_000UL; void main() { StopWatch sw; sw.start; auto sum1 =

zip.map.reduce at CT?

2012-10-02 Thread bearophile
Do you know if here the problem is in Phobos or if I'm asking Phobos to do something too much hard? import std.algorithm: map, reduce; import std.range: zip; struct S {} alias bool function(S) F; F foo(T)(T) { return p = true; } F bar(F r1, F r2) { return p = true; } F spam(S[] ps) {

how to call std_stdio_static_this from a dynamically loaded shared library (osx)

2012-10-02 Thread timotheecour
How do I call std_stdio_static_this() in std.stdio from a dynamically loaded shared library (osx) ? I need to do this in my scenario: 1) main program is launched 2) dynamic library is created 3) dynamic library is loaded and a function from it is called 4) everything works fine until a

Re: Functional vs simple code

2012-10-02 Thread ixid
On Tuesday, 2 October 2012 at 22:13:10 UTC, Timon Gehr wrote: On 10/03/2012 12:11 AM, Timon Gehr wrote: ... $ cat ixidbench.d module main; import std.stdio, std.algorithm, std.range, std.datetime; enum MAX = 10_000_000_000UL; void main() { StopWatch sw; sw.start; auto sum1 =

Re: Functional vs simple code

2012-10-02 Thread Tommi
On Wednesday, 3 October 2012 at 01:21:38 UTC, ixid wrote: If it were (range, seed) then there would be no problem: [1,1,1].reduce!a + b + 2(0).writeln; // == 9 My thoughts exactly.

Re: Functional vs simple code

2012-10-02 Thread jerro
While fiddling with this I came across something that seems odd in the behaviour of reduce and wondered if it's intended. It rather limits the usefulness of reduce with UFCS to a + b and a - b. Reduce works correctly when provided with a seed argument: reduce!a + b + 2(0, [1,1,1]).writeln;

Re: Functional vs simple code

2012-10-02 Thread ixid
A typical use case is to find the maximum of a range (there is an example of this in the documentation at http://dlang.org/phobos/std_algorithm.html#reduce). If you don't know the highest possible value of elements, then you couldn't come up with an appropriate seed for this case. Fixing

[Issue 8741] wrong code for struct member initialized using struct constructor

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8741 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||wrong-code

[Issue 8741] wrong code for struct member initialized using struct constructor

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8741 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||pull --- Comment #2 from

[Issue 8745] floating point comparison (is vs ==) inconsistency (on 32)

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8745 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||clugd...@yahoo.com.au ---

[Issue 8745] floating point comparison (is vs ==) inconsistency (on 32)

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8745 --- Comment #2 from monarchdo...@gmail.com 2012-10-02 01:19:17 PDT --- (In reply to comment #1) The idea that for floating point, 'is' and '==' should be the same, is wrong. See bug 3632 for further discussion. I suspect this is a duplicate

[Issue 8743] Add support for memoizing class methods

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8743 --- Comment #5 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-10-02 02:25:42 PDT --- (In reply to comment #4) void rehash() { memo = null; } Maybe do you mean something like this? void rehash() { memo.rehash; } void clear() {

[Issue 8743] Add support for memoizing class methods

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8743 --- Comment #6 from bearophile_h...@eml.cc 2012-10-02 02:54:21 PDT --- (In reply to comment #5) enum bool isClassStruct = (is(fun == class) || is(fun == struct)); No need for extra parentheses: enum bool isClassStruct = is(fun == class)

[Issue 8746] New: rehash AA property doesn't work with constant Tuple

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8746 Summary: rehash AA property doesn't work with constant Tuple Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2

[Issue 8743] Add support for memoizing class methods

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8743 --- Comment #8 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-10-02 03:08:44 PDT --- (In reply to comment #6) This mixin template is useful. A disadvantage is that it doesn't follow the API (usage) of the Phobos memoize. So maybe it

[Issue 8743] Add support for memoizing class methods

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8743 --- Comment #7 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-10-02 03:05:48 PDT --- (In reply to comment #6) If the arguments are constant it doesn't work: int slowFunc(in int a, in int b) Seems to be a new bug related to Tuple:

[Issue 8743] Add support for memoizing class methods

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8743 --- Comment #9 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-10-02 03:12:47 PDT --- (In reply to comment #8) (In reply to comment #6) This mixin template is useful. A disadvantage is that it doesn't follow the API (usage) of the

[Issue 8743] Add support for memoizing class methods

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8743 --- Comment #10 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-10-02 03:17:42 PDT --- (In reply to comment #9) (In reply to comment #8) (In reply to comment #6) This mixin template is useful. A disadvantage is that it doesn't

[Issue 8575] Lambda expression causes compilation error with template function

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8575 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull, rejects-valid

[Issue 8745] floating point comparison (is vs ==) inconsistency (on 32)

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8745 Rainer Schuetze r.sagita...@gmx.de changed: What|Removed |Added CC||r.sagita...@gmx.de

[Issue 8655] bitfields and Typedef don't mix

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8655 --- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-10-02 16:04:02 PDT --- (In reply to comment #0) import std.typecons; import std.bitmanip; static import core.stdc.config; alias Typedef!(core.stdc.config.c_ulong)

[Issue 8544] Expose cArgs in druntime

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8544 --- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-10-02 16:53:34 PDT --- I'd like to fix this myself. But I'm not sure how this should be exposed in the Runtime struct. Should it be two properties, 'argc' and 'argv', or a

[Issue 8544] Expose cArgs in druntime

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8544 --- Comment #2 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-10-02 16:54:34 PDT --- (In reply to comment #1) I'd like to fix this myself. But I'm not sure how this should be exposed in the Runtime struct. Should it be two

[Issue 8544] Expose cArgs in druntime

2012-10-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8544 Alex R�nne Petersen a...@lycus.org changed: What|Removed |Added CC||a...@lycus.org

<    1   2